Customized fork of github.com/rxi/lite
1#ifndef RENDERER_H
2#define RENDERER_H
3
4#include <SDL3/SDL.h>
5#include <stdlib.h>
6#include <stdint.h>
7
8typedef struct RenImage RenImage;
9typedef struct RenFont RenFont;
10
11typedef struct
12{
13 uint8_t b, g, r, a;
14} RenColor;
15
16typedef struct
17{
18 int x, y, width, height;
19} RenRect;
20
21
22void ren_init(SDL_Window *win);
23void ren_update_rects(RenRect *rects, int count);
24void ren_set_clip_rect(RenRect rect);
25void ren_get_size(int *x, int *y);
26
27RenImage* ren_new_image(int width, int height);
28void ren_free_image(RenImage *image);
29
30RenFont* ren_load_font(const char *filename, float size);
31void ren_free_font(RenFont *font);
32void ren_set_font_tab_width(RenFont *font, int n);
33int ren_get_font_tab_width(RenFont *font);
34int ren_get_font_width(RenFont *font, const char *text);
35int ren_get_font_height(RenFont *font);
36
37void ren_draw_rect(RenRect rect, RenColor color);
38void ren_draw_image(RenImage *image, RenRect *sub, int x, int y, RenColor color);
39int ren_draw_text(RenFont *font, const char *text, int x, int y, RenColor color);
40
41#endif