2019-12-28 12:16:32 +01:00
|
|
|
#ifndef RENDERER_H
|
|
|
|
#define RENDERER_H
|
|
|
|
|
2020-06-29 15:24:08 +02:00
|
|
|
#include <SDL.h>
|
2019-12-28 12:16:32 +01:00
|
|
|
#include <stdint.h>
|
2021-09-11 04:22:30 +02:00
|
|
|
#include <stdbool.h>
|
2020-12-04 16:15:54 +01:00
|
|
|
|
2021-09-11 04:22:30 +02:00
|
|
|
typedef struct RenFont RenFont;
|
|
|
|
typedef enum { FONT_HINTING_NONE, FONT_HINTING_SLIGHT, FONT_HINTING_FULL } ERenFontHinting;
|
2019-12-28 12:16:32 +01:00
|
|
|
typedef struct { uint8_t b, g, r, a; } RenColor;
|
|
|
|
typedef struct { int x, y, width, height; } RenRect;
|
|
|
|
|
2021-09-11 04:22:30 +02:00
|
|
|
RenFont* ren_font_load(const char *filename, float size, bool subpixel, unsigned char hinting);
|
|
|
|
RenFont* ren_font_copy(RenFont* font, float size);
|
|
|
|
void ren_font_free(RenFont *font);
|
|
|
|
void ren_font_set_tab_size(RenFont *font, int n);
|
|
|
|
int ren_font_get_tab_size(RenFont *font);
|
|
|
|
int ren_font_get_width(RenFont *font, const char *text);
|
|
|
|
int ren_font_get_height(RenFont *font);
|
|
|
|
float ren_font_get_size(RenFont *font);
|
|
|
|
int ren_draw_text(RenFont *font, const char *text, float x, int y, RenColor color);
|
2021-03-31 17:33:35 +02:00
|
|
|
|
2021-09-11 04:22:30 +02:00
|
|
|
void ren_draw_rect(RenRect rect, RenColor color);
|
2019-12-28 12:16:32 +01:00
|
|
|
|
|
|
|
void ren_init(SDL_Window *win);
|
2021-04-29 14:15:24 +02:00
|
|
|
void ren_resize_window();
|
2019-12-28 12:16:32 +01:00
|
|
|
void ren_update_rects(RenRect *rects, int count);
|
|
|
|
void ren_set_clip_rect(RenRect rect);
|
2021-04-24 10:21:34 +02:00
|
|
|
void ren_get_size(int *x, int *y); /* Reports the size in points. */
|
2021-04-23 14:54:25 +02:00
|
|
|
void ren_free_window_resources();
|
2019-12-28 12:16:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|