load fonts at runtime

This commit is contained in:
Alessandro Mauri 2023-03-04 18:54:00 +01:00
parent 30510ab69a
commit 93f93a594e
5 changed files with 87 additions and 36 deletions

View file

@ -15,7 +15,9 @@ SDL_Window *win;
void draw(void)
{
ren_clear();
ren_render_text(str, 0, 0, 100, 50, 12);
if (ren_render_text(str, 0, 0, 100, 50, 20))
printf("text: %s\n", ren_strerror());
ren_render_text("altro font", 200, 40, 300, 300, 40);
ren_render_box(100, 300, 50, 50, 0xffff0000);
SDL_GL_SwapWindow(win);
}