From 44a4b6928cd0acdf39c67f12d0e2cc4dcbe53167 Mon Sep 17 00:00:00 2001 From: Sara Date: Thu, 11 May 2023 21:09:49 +0200 Subject: [PATCH] engine now uses displaymode to automatically start at desktop size --- src/engine.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/engine.c b/src/engine.c index d3b6e14..e0715b6 100644 --- a/src/engine.c +++ b/src/engine.c @@ -29,7 +29,7 @@ int _engine_shutdown() { static inline void _handle_events() { while(SDL_PollEvent(&g_context.event)) { - input_event(g_context.event); + input_notify_event(g_context.event); switch(g_context.event.type) { case SDL_QUIT: g_context.running = 0; @@ -40,7 +40,9 @@ void _handle_events() { static inline 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){ .window = window,