39 lines
638 B
C
Raw Normal View History

2023-02-21 22:05:28 +01:00
#include <SDL2/SDL.h>
#include <SDL2/SDL_events.h>
2023-02-12 09:34:44 +01:00
#include <stdlib.h>
#include <stdio.h>
2023-02-19 23:40:58 +01:00
#include "ren.h"
2023-02-15 02:15:44 +01:00
#include "util.h"
2023-02-12 09:34:44 +01:00
int main(void)
{
2023-02-19 23:40:58 +01:00
SDL_Window *win = SDL_CreateWindow(
"test render",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
500,
500,
SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
if (ren_init(win)) {
printf("renderer init error: %s\n", ren_strerror());
return 1;
2023-02-12 09:34:44 +01:00
}
2023-02-19 23:40:58 +01:00
ren_render_text("ciao mamma", 100, 100, 100, 100, 12);
SDL_GL_SwapWindow(win);
2023-02-15 02:15:44 +01:00
2023-02-21 22:05:28 +01:00
SDL_Event e;
while(1) {
SDL_WaitEvent(&e);
if (e.type == SDL_QUIT)
break;
}
2023-02-15 02:15:44 +01:00
2023-02-19 23:40:58 +01:00
ren_free();
SDL_DestroyWindow(win);
2023-02-21 22:05:28 +01:00
SDL_Quit();
2023-02-12 09:34:44 +01:00
return 0;
}