diff options
author | jacopograndi <jak.sk8@hotmail.it> | 2021-08-29 13:57:41 +0200 |
---|---|---|
committer | jacopograndi <jak.sk8@hotmail.it> | 2021-08-29 13:57:41 +0200 |
commit | ace5c3f3093c50ff7fa6f8b281a377e3788abbd5 (patch) | |
tree | 8a52803dc2b777822e9b1cab148bec8798bfeadf /commands | |
parent | a8bcacc95045102e67f2feabbdddf79535837554 (diff) |
adding techs
Diffstat (limited to 'commands')
-rw-r--r-- | commands/commands.cpp | 6 | ||||
-rw-r--r-- | commands/commands.h | 2 |
2 files changed, 8 insertions, 0 deletions
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; } diff --git a/commands/commands.h b/commands/commands.h index 665c8b6..5513790 100644 --- a/commands/commands.h +++ b/commands/commands.h @@ -20,6 +20,8 @@ class Commands_sdl { int mclick[3]; int mheld[3]; + int resx, resy; + private: std::vector<SDL_Scancode> keys; std::vector<SDL_Scancode> keysdown; |