From ace5c3f3093c50ff7fa6f8b281a377e3788abbd5 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Sun, 29 Aug 2021 13:57:41 +0200 Subject: adding techs --- commands/commands.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'commands/commands.cpp') diff --git a/commands/commands.cpp b/commands/commands.cpp index df7aed5..7053316 100644 --- a/commands/commands.cpp +++ b/commands/commands.cpp @@ -23,6 +23,8 @@ bool Commands_sdl::check_key (SDL_Scancode key) { bool Commands_sdl::process_events () { SDL_GetMouseState(&mx, &my); + resx = -1; resy = -1; + SDL_Event e; while(SDL_PollEvent(&e) != 0) { if(e.type == SDL_QUIT) { @@ -47,6 +49,10 @@ bool Commands_sdl::process_events () { if (e.button.button == SDL_BUTTON_MIDDLE) { mclick[1] = 0; } if (e.button.button == SDL_BUTTON_RIGHT) { mclick[2] = 0; } } + if(e.type == SDL_WINDOWEVENT + && e.window.event == SDL_WINDOWEVENT_RESIZED ) { + resx = e.window.data1; resy = e.window.data2; + } } return false; } -- cgit v1.2.3-54-g00ecf