summaryrefslogtreecommitdiff
path: root/src/contrib/SDL-3.2.20/cmake/test/main_gui.c
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
committer3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
commit6aaedb813fa11ba0679c3051bc2eb28646b9506c (patch)
tree34acbfc9840e02cb4753e6306ea7ce978bf8b58e /src/contrib/SDL-3.2.20/cmake/test/main_gui.c
parent8f228ade99dd3d4c8da9b78ade1815c9adf85c8f (diff)
Update to SDL3
Diffstat (limited to 'src/contrib/SDL-3.2.20/cmake/test/main_gui.c')
-rw-r--r--src/contrib/SDL-3.2.20/cmake/test/main_gui.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/cmake/test/main_gui.c b/src/contrib/SDL-3.2.20/cmake/test/main_gui.c
new file mode 100644
index 0000000..18ed101
--- /dev/null
+++ b/src/contrib/SDL-3.2.20/cmake/test/main_gui.c
@@ -0,0 +1,24 @@
1#include <SDL3/SDL.h>
2#include <SDL3/SDL_main.h>
3
4int main(int argc, char *argv[])
5{
6 SDL_Window *window = NULL;
7 SDL_Surface *screenSurface = NULL;
8 if (!SDL_Init(SDL_INIT_VIDEO)) {
9 SDL_Log("Could not initialize SDL: %s", SDL_GetError());
10 return 1;
11 }
12 window = SDL_CreateWindow("Hello SDL", 640, 480, 0);
13 if (!window) {
14 SDL_Log("could not create window: %s", SDL_GetError());
15 return 1;
16 }
17 screenSurface = SDL_GetWindowSurface(window);
18 SDL_FillSurfaceRect(screenSurface, NULL, SDL_MapSurfaceRGB(screenSurface, 0xff, 0xff, 0xff));
19 SDL_UpdateWindowSurface(window);
20 SDL_Delay(100);
21 SDL_DestroyWindow(window);
22 SDL_Quit();
23 return 0;
24}