VSGL2 - Very Simple Graphic Library 2
2.0
|
Functions | |
bool | done () |
Use this function to check when to stop the main loop. More... | |
void | undone () |
Use this function to reset the isDone glabal variable to its initial state (false) This can be useful when you want to use the done() function more then one time inside a program, i.e. in a video game to restart a new game. More... | |
void | update () |
Use this function to update the screen after drawing on it Typically called at the end of the main loop. More... | |
void | draw_point (int x, int y, const Color &c) |
Use to draw a point at x,y coordinates. More... | |
void | draw_rect (int x, int y, int w, int h, const Color &c) |
Use to draw a rectangle (only the border), use instead draw_filled_rect to draw a rectangle filled with color. More... | |
void | draw_filled_rect (int x, int y, int w, int h, const Color &c) |
Use to draw a filled rectangle, use instead draw_rect to draw an empty rectangle with colored borders. More... | |
void | draw_line (int x1, int y1, int x2, int y2, const Color &c) |
Use to draw a line. More... | |
void | draw_image (string image, int x, int y, int w, int h, uint8_t alpha=255) |
Use to draw an image (BMP, PNG, JPG) More... | |
bool done | ( | ) |
Use this function to check when to stop the main loop.
void draw_filled_rect | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
const Color & | c | ||
) |
Use to draw a filled rectangle, use instead draw_rect to draw an empty rectangle with colored borders.
x | The x coordinate of the upper left corner |
y | The y coordinate of the upper left corner |
w | The width of the rectangle |
h | The height of the rectangle |
c | The color of the borders of the rectangle |
void draw_image | ( | string | image, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
uint8_t | alpha = 255 |
||
) |
Use to draw an image (BMP, PNG, JPG)
image | The image name, either absolute or relative |
x | The x coordinate of the upper left corner of the image inside the window coordinates |
y | The y coordinate of the upper left corner of the image inside the window coordinates |
w | The width of the image as it will appear inside the window, not its original value |
h | The height of the image as it will appear inside the window, not its original value |
[alpha] | The transparency value for the image: with 255 (the default), the image will look as the original, with 0 the image will become invisible |
void draw_line | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
const Color & | c | ||
) |
Use to draw a line.
x1 | The x coordinate of an end point |
y1 | The y coordinate of an end point |
x2 | The x coordinate of the other end point |
y2 | The y coordinate of the other end point |
c | The color of the line |
void draw_point | ( | int | x, |
int | y, | ||
const Color & | c | ||
) |
Use to draw a point at x,y coordinates.
x | The x coordinate |
y | The y coordinate |
c | The color of the point |
void draw_rect | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
const Color & | c | ||
) |
Use to draw a rectangle (only the border), use instead draw_filled_rect to draw a rectangle filled with color.
x | The x coordinate of the upper left corner |
y | The y coordinate of the upper left corner |
w | The width of the rectangle |
h | The height of the rectangle |
c | The color of the rectangle |
void undone | ( | ) |
Use this function to reset the isDone glabal variable to its initial state (false) This can be useful when you want to use the done() function more then one time inside a program, i.e. in a video game to restart a new game.
void update | ( | ) |
Use this function to update the screen after drawing on it Typically called at the end of the main loop.