37 #include <SDL2/SDL_render.h>
74 void fill(
const SDL_Rect&
rect, uint8_t r, uint8_t
g, uint8_t
b, uint8_t a);
75 void fill(
const SDL_Rect&
rect, uint8_t r, uint8_t
g, uint8_t
b);
77 void fill(uint8_t r, uint8_t
g, uint8_t
b, uint8_t a);
78 void fill(uint8_t r, uint8_t
g, uint8_t
b);
106 void set_color(uint8_t r, uint8_t
g, uint8_t
b, uint8_t a);
137 void rect(
const SDL_Rect&
rect, uint8_t r, uint8_t
g, uint8_t
b, uint8_t a);
138 void rect(
const SDL_Rect&
rect, uint8_t r, uint8_t
g, uint8_t
b);
152 void line(
int from_x,
int from_y,
int to_x,
int to_y);
163 void line(
int from_x,
int from_y,
int to_x,
int to_y,
const color_t&
c);
169 void point(
int x,
int y);
190 void circle(
int x,
int y,
int r,
const color_t&
c, uint8_t octants = 0xff);
191 void circle(
int x,
int y,
int r, uint8_t octants = 0xff);
208 void disc(
int x,
int y,
int r,
const color_t&
c, uint8_t octants = 0xff);
209 void disc(
int x,
int y,
int r, uint8_t octants = 0xff);
254 void flipped(
const texture& tex,
bool flip_h =
true,
bool flip_v =
false);
275 bool centered =
false,
276 bool mirrored =
false
286 bool centered =
false,
287 bool mirrored =
false
312 const SDL_Color& cTL,
const SDL_Color& cTR,
313 const SDL_Color& cBL,
const SDL_Color& cBR,
314 const SDL_FPoint& uvTL,
const SDL_FPoint& uvTR,
315 const SDL_FPoint& uvBL,
const SDL_FPoint& uvBR
318 const SDL_Color& cTL,
const SDL_Color& cTR,
319 const SDL_Color& cBL,
const SDL_Color& cBR
322 const std::array<SDL_Vertex, 4>& verts
A class to manage automatic restoration of the clipping region.
clip_setter(const SDL_Rect &clip)
A class to manage automatic restoration of the render target.
render_target_setter(const texture &t)
A class to manage automatic restoration of the viewport region.
viewport_setter(const SDL_Rect &viewport)
Wrapper class to encapsulate creation and management of an SDL_Texture.
viewport_setter set_viewport(const SDL_Rect &viewport)
Set the viewport.
void force_viewport(const SDL_Rect &viewport)
Set the viewport, without any provided way of setting it back.
render_target_setter set_render_target(const texture &t)
Set the given texture as the active render target.
clip_setter override_clip(const SDL_Rect &clip)
Override the clipping area.
void circle(int x, int y, int r, const color_t &c, uint8_t octants=0xff)
Draw a circle of the given colour.
void points(const std::vector< SDL_Point > &points)
Draw a set of points.
void force_clip(const SDL_Rect &clip)
Set the clipping area, without any provided way of setting it back.
SDL_Rect get_viewport()
Get the current viewport.
bool null_clip()
Whether the current clipping region will disallow drawing.
clip_setter reduce_clip(const SDL_Rect &clip)
Set the clipping area to the intersection of the current clipping area and the given rectangle.
bool clip_enabled()
Whether clipping is enabled.
void tiled(const texture &tex, const SDL_Rect &dst, bool centered=false, bool mirrored=false)
Tile a texture to fill a region.
void disc(int x, int y, int r, const color_t &c, uint8_t octants=0xff)
Draw a solid disc of the given colour.
void set_color(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Set the drawing colour.
void flipped(const texture &tex, const SDL_Rect &dst, bool flip_h=true, bool flip_v=false)
Draws a texture, or part of a texture, at the given location, also mirroring/flipping the texture hor...
void fill(const SDL_Rect &rect, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Fill an area with the given colour.
void point(int x, int y)
Draw a single point.
void clear()
Clear the current render target.
void set_blend_mode(SDL_BlendMode b)
Set the blend mode used for drawing operations such as fill() and line().
void blit(const texture &tex, const SDL_Rect &dst)
Draws a texture, or part of a texture, at the given location.
void tiled_highres(const texture &tex, const SDL_Rect &dst, bool centered=false, bool mirrored=false)
Tile a texture to fill a region.
::rect get_clip()
Get the current clipping area, in draw coordinates.
void rect(const SDL_Rect &rect)
Draw a rectangle.
void disable_clip()
Disable clipping.
void line(int from_x, int from_y, int to_x, int to_y)
Draw a line.
void smooth_shaded(const texture &tex, const SDL_Rect &dst, const SDL_Color &cTL, const SDL_Color &cTR, const SDL_Color &cBL, const SDL_Color &cBR, const SDL_FPoint &uvTL, const SDL_FPoint &uvTR, const SDL_FPoint &uvBL, const SDL_FPoint &uvBR)
Draw a texture with smoothly varying colour and alpha modification, specified at the four corners of ...
Contains the SDL_Rect helper code.
rect dst
Location on the final composed sheet.
The basic class for representing 8-bit RGB or RGBA colour values.
An abstract description of a rectangle with integer coordinates.