]> git.lizzy.rs Git - nothing.git/blob - src/sdl/renderer.h
Merge pull request #567 from tsoding/542
[nothing.git] / src / sdl / renderer.h
1 #ifndef RENDERER_H_
2 #define RENDERER_H_
3
4 #include <SDL2/SDL.h>
5
6 #include "color.h"
7 #include "math/point.h"
8 #include "math/triangle.h"
9
10 // TODO(#474): there are no logging SDL wrappers (similar to system/nth_alloc)
11 int draw_triangle(SDL_Renderer *render,
12                   Triangle t);
13
14 int fill_triangle(SDL_Renderer *render,
15                   Triangle t);
16
17 int fill_rect(SDL_Renderer *render,
18               Rect r,
19               Color c);
20
21 /* `getpixel()` and `putpixel()` were stolen from
22  * https://www.libsdl.org/release/SDL-1.2.15/docs/html/guidevideo.html */
23 Uint32 getpixel(SDL_Surface *surface, int x, int y);
24 void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
25
26 #endif  // RENDERER_H_