blob: 3626fed8c61514940af8ee2f85cfb5e277fcc745 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include "TZR_render.h"
#include "TZR_globals.h"
#include "sdl_error.h"
#include <SDL2/SDL_render.h>
int TZR_DrawRectangle(bool fill, int x, int y, int w, int h)
{
const SDL_Rect rect = { x, y, w, h };
if (fill) {
if (SDL_RenderFillRect(___tzr_renderer, &rect) < 0)
return sdl_error(-1);
} else {
if (SDL_RenderDrawRect(___tzr_renderer, &rect) < 0)
return sdl_error(-1);
}
return 0;
}
|