WHY_CPP
0.1
|
Functions to draw something on the screen. More...
Classes | |
struct | RGBA |
Functions | |
i32 | GetDisplayWidth (const Context &context) |
i32 | GetDisplayHeight (const Context &context) |
void | SetPixel (Context &context, i32 x, i32 y, const RGBA &color) |
const RGBA | GetPixel (const Context &context, i32 x, i32 y) |
void | DrawClearScreen (Context &context, const RGBA &color={0, 0, 0, 255}) |
void | DrawLine (Context &context, i32 x0, i32 y0, i32 x1, i32 y1, const RGBA &color) |
void | DrawRectFill (Context &context, i32 x, i32 y, i32 w, i32 h, const RGBA &color) |
void | DrawRect (Context &context, i32 x, i32 y, i32 w, i32 h, const RGBA &color) |
void | DrawCircle (Context &context, i32 x, i32 y, i32 radius, const RGBA &color) |
void | DrawCircleFill (Context &context, i32 x, i32 y, i32 radius, const RGBA &color) |
void | DrawSprite (Context &context, i32 sprite_id, i32 screen_x, i32 screen_y, i32 sheet_x, i32 sheet_y, i32 width, i32 height) |
Functions to draw something on the screen.
Draw a circle border with the color. Circle body is transparent
context | |
x | coordinate of the circle's center |
y | coordinate of the circle's center |
radius | |
color |
Definition at line 58 of file drawing.cpp.
References SetPixel().
Draw a circle border with the color. Circle body is filled with the same color as the border.
context | |
x | coordinate of the circle's center |
y | coordinate of the circle's center |
radius | |
color |
Definition at line 74 of file drawing.cpp.
References SetPixel().
Fill the screen with a solid color
context | |
color | to fill the screen |
Definition at line 23 of file drawing.cpp.
Draw line on the screen from the [x0,y0] to the [x1,y1] with a color.
context | |
x0 | coordinate of the first point |
y0 | coordinate of the first point |
x1 | coordinate of the second point |
y1 | coordinate of the second point |
color | of the line |
Definition at line 26 of file drawing.cpp.
References SetPixel().
Referenced by DrawRect(), and DrawRectFill().
Draw a rectangle borders with the color. Rectangle body is transparent.
To draw it you need a left-upper corner coordinates [x,y] and rectangle width and height.
context | |
x | coordinate of the left-upper corner |
y | coordinate of the left-upper corner |
w | width of the rectangle to draw |
h | width of the rectangle to draw |
color | of the borders and filler |
Definition at line 51 of file drawing.cpp.
References DrawLine().
Draw a rectangle and fill it with color. To draw it you need a left-upper corner coordinates [x,y] and rectangle width and height.
context | |
x | coordinate of the left-upper corner |
y | coordinate of the left-upper corner |
w | width of the rectangle to draw |
h | width of the rectangle to draw |
color | of the borders and filler |
Definition at line 46 of file drawing.cpp.
References DrawLine().
i32 GetDisplayHeight | ( | const Context & | context | ) |
i32 GetDisplayWidth | ( | const Context & | context | ) |
Get the pixel color at the [x,y] position
context | of the application |
x | coordinate of the pixel on the screen |
y | coordinate of the pixel on the screen |
Definition at line 20 of file drawing.cpp.
Set the pixel color at the [x,y] position
context | of the application |
x | coordinate of the pixel on the screen |
y | coordinate of the pixel on the screen |
color | of the pixel |
Definition at line 16 of file drawing.cpp.
Referenced by DrawCircle(), DrawCircleFill(), DrawLine(), and Print().