engine now uses displaymode to automatically start at desktop size

pull/5/head
Sara 2023-05-11 21:09:49 +02:00
parent 4d4547551c
commit 44a4b6928c
1 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,7 @@ int _engine_shutdown() {
static inline static inline
void _handle_events() { void _handle_events() {
while(SDL_PollEvent(&g_context.event)) { while(SDL_PollEvent(&g_context.event)) {
input_event(g_context.event); input_notify_event(g_context.event);
switch(g_context.event.type) { switch(g_context.event.type) {
case SDL_QUIT: case SDL_QUIT:
g_context.running = 0; g_context.running = 0;
@ -40,7 +40,9 @@ void _handle_events() {
static inline static inline
int _engine_run() { int _engine_run() {
SDL_Window* window = SDL_CreateWindow("Tabletop", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 420, SDL_WINDOW_FULLSCREEN_DESKTOP); SDL_DisplayMode mode;
SDL_GetDesktopDisplayMode(0, &mode);
SDL_Window* window = SDL_CreateWindow("Tabletop", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, mode.w, mode.h, SDL_WINDOW_FULLSCREEN_DESKTOP);
g_context = (context_t){ g_context = (context_t){
.window = window, .window = window,