From 0049dc9cf781c65f5a633f51f0e705274853060c Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 8 Nov 2022 18:36:04 -0500 Subject: more info, SDL example --- tests/sdl.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/sdl.c (limited to 'tests') diff --git a/tests/sdl.c b/tests/sdl.c new file mode 100644 index 0000000..a3c3d8f --- /dev/null +++ b/tests/sdl.c @@ -0,0 +1,30 @@ +#define SDL_DISABLE_IMMINTRIN_H +#include +#include +#include +#include + +int main(void) { + SDL_Init(SDL_INIT_EVERYTHING); + SDL_Window *window = SDL_CreateWindow("hi", 0, 0, 1280, 720, SDL_WINDOW_SHOWN|SDL_WINDOW_OPENGL); + SDL_GLContext ctx = SDL_GL_CreateContext(window); + PFNGLCLEARPROC glClear = SDL_GL_GetProcAddress("glClear"); + PFNGLCLEARCOLORPROC glClearColor = SDL_GL_GetProcAddress("glClearColor"); + SDL_GL_SetSwapInterval(1); + while (true) { + SDL_Event event; + while (SDL_PollEvent(&event)) { + if (event.type == SDL_QUIT) { + return 0; + } + } + glClearColor(1, 1, 1, 1); + glClear(GL_COLOR_BUFFER_BIT); + SDL_GL_SwapWindow(window); + } + (void)ctx; +} + +void entry(void) { + exit(main()); +} -- cgit v1.2.3