33 static std::unique_ptr<Graphics>
create(SDL_Window *window,
36 SDLGraphics(SDL_Window *window, SDL_Renderer *renderer);
41 void updateSize(
int windowWidth,
int windowHeight,
float scale)
override;
46 int width,
int height,
47 int desiredWidth,
int desiredHeight,
48 bool useColor)
override;
50#if SDL_VERSION_ATLEAST(2, 0, 10)
53 float dstX,
float dstY,
54 int width,
int height,
55 float desiredWidth,
float desiredHeight,
56 bool useColor)
override;
65 int scaledHeight)
override;
70 float &logicalX,
float &logicalY)
const override;
76 void drawLine(
int x1,
int y1,
int x2,
int y2)
override;
A central point of control for graphics.
virtual bool drawRescaledImageF(const Image *image, int srcX, int srcY, float dstX, float dstY, int width, int height, float desiredWidth, float desiredHeight, bool useColor=false)
Draws a rescaled version of the image.
Defines a class for loading and storing images.
static std::unique_ptr< Graphics > create(SDL_Window *window, const VideoSettings &settings)
SDL_Surface * getScreenshot() override
Takes a screenshot and returns it as SDL surface.
void updateClipRect() override
void drawRescaledImagePattern(const Image *image, int srcX, int srcY, int srcW, int srcH, int dstX, int dstY, int dstW, int dstH, int scaledWidth, int scaledHeight) override
Draw a pattern based on a rescaled version of the given image.
void drawPoint(int x, int y) override
void updateScreen() override
Updates the screen.
void setVSync(bool sync) override
Sets whether vertical refresh syncing is enabled.
void updateSize(int windowWidth, int windowHeight, float scale) override
Called when the window size or scale has changed.
bool drawRescaledImage(const Image *image, int srcX, int srcY, int dstX, int dstY, int width, int height, int desiredWidth, int desiredHeight, bool useColor) override
Draws a rescaled version of the image.
void setColorAlphaMod(const Image *image, bool useColor) const
void windowToLogical(int windowX, int windowY, float &logicalX, float &logicalY) const override
Converts a window coordinate to a logical coordinate.
void drawRectangle(const gcn::Rectangle &rectangle) override
void drawLine(int x1, int y1, int x2, int y2) override
void fillRectangle(const gcn::Rectangle &rectangle) override