diff options
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.c | 24 |
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 | |||
4 | int 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 | } | ||