Display empty window
This commit is contained in:
parent
c79a4d88b8
commit
17cbce46fb
1 changed files with 36 additions and 1 deletions
37
src/main.c
37
src/main.c
|
|
@ -1,5 +1,40 @@
|
|||
#include <SDL3/SDL.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue