From 17cbce46fb9cfc33531d9ee8f3369e0cffe791bf Mon Sep 17 00:00:00 2001 From: Harry Culpan Date: Thu, 23 Jul 2026 19:51:48 -0400 Subject: [PATCH] Display empty window --- src/main.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 7c1035f..f23a348 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,40 @@ +#include +#include #include int main() { - printf("Hello world!\n"); + SDL_Window *wnd; + + printf("Initalizing SDL3\n"); + if (!SDL_Init(SDL_INIT_VIDEO)) { + SDL_Log("SDL_Init: %s", SDL_GetError()); + return 1; + }; + + wnd = SDL_CreateWindow("My Amazing 3D Project", 1900, 1068, + SDL_WINDOW_RESIZABLE); + if (!wnd) { + SDL_Log("SDL_CreateWindow: %s", SDL_GetError()); + return 1; + } + + bool running = true; + SDL_Event event; + while (running) { + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_EVENT_QUIT: + running = false; + break; + default: + break; + } + } + } + + SDL_DestroyWindow(wnd); + SDL_Quit(); + + printf("Exiting\n"); + return 0; }