summaryrefslogtreecommitdiff
path: root/contrib/SDL-3.2.8/cmake/test/main_gui.c
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-12-27 12:03:39 -0800
committer3gg <3gg@shellblade.net>2025-12-27 12:03:39 -0800
commit5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch)
tree8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/cmake/test/main_gui.c
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/cmake/test/main_gui.c')
-rw-r--r--contrib/SDL-3.2.8/cmake/test/main_gui.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/cmake/test/main_gui.c b/contrib/SDL-3.2.8/cmake/test/main_gui.c
new file mode 100644
index 0000000..18ed101
--- /dev/null
+++ b/contrib/SDL-3.2.8/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}