render boxes

This commit is contained in:
Alessandro Mauri 2023-02-25 22:50:31 +01:00
parent 9de467eae9
commit a7a2193ea6
No known key found for this signature in database
GPG key ID: 2B7BF9531FF03BE8
5 changed files with 174 additions and 18 deletions

View file

@ -7,6 +7,8 @@
#define FONT_PATH "./monospace.ttf"
#define FONT_VERSHADER "./font_vertshader.glsl"
#define FONT_FRAGSHADER "./font_fragshader.glsl"
#define BOX_VERSHADER "./box_vertshader.glsl"
#define BOX_FRAGSHADER "./box_fragshader.glsl"
#define REN_VERTEX_IDX 0
#define REN_UV_IDX 1
#define REN_COLOR_IDX 2
@ -33,7 +35,7 @@ struct v_text {
// colored vertex
struct v_col {
vec2_i pos;
vec2_i col;
vec4_i col;
};
@ -42,6 +44,9 @@ int ren_free(void);
const char * ren_strerror(void);
int ren_update_viewport(int w, int h);
int ren_render_text(const char *str, int x, int y, int w, int h, int size);
int ren_set_scissor(int x, int y, int w, int h);
int ren_render_box(int x, int y, int w, int h, unsigned int color);
int ren_clear(void);
#endif