draw point
This commit is contained in:
parent
76e13d2909
commit
2665f29f72
14
inc/lzy.h
14
inc/lzy.h
|
@ -50,6 +50,7 @@ int LZY_DrawEnd(void);
|
|||
void LZY_DrawSetColor(uint8_t r, uint8_t g, uint8_t b);
|
||||
void LZY_DrawSetColorNone(void);
|
||||
int LZY_DrawClear(void);
|
||||
int LZY_DrawPoint(int x, int y);
|
||||
int LZY_DrawRect(int x, int y, unsigned int w, unsigned int h);
|
||||
int LZY_DrawFillRect(int x, int y, unsigned int w, unsigned int h);
|
||||
int LZY_DrawTile(unsigned int id, int x, int y);
|
||||
|
@ -208,6 +209,11 @@ int LZY_DrawClear(void) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int LZY_DrawPoint(int x, int y) {
|
||||
dpixel(x, y, draw_color);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LZY_DrawRect(int x, int y, unsigned int w, unsigned int h) {
|
||||
if (w < 1 || h < 1)
|
||||
return -1;
|
||||
|
@ -543,6 +549,14 @@ int LZY_DrawClear(void) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int LZY_DrawPoint(int x, int y) {
|
||||
if (SDL_RenderDrawPoint(renderer, x, y) < 0) {
|
||||
error = SDL_GetError();
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LZY_DrawRect(int x, int y, unsigned int w, unsigned int h) {
|
||||
const SDL_Rect rect = {x, y, w, h};
|
||||
|
||||
|
|
Loading…
Reference in New Issue