diff options
| author | realtradam <[email protected]> | 2023-06-02 21:29:13 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-06-02 21:29:13 -0400 |
| commit | 9eaee25e671d47dcb7a2cbb333e6d3283401087f (patch) | |
| tree | a35e8b71dc1a79797e554d89a88742de079d81c8 /src/input/rodeo_input.c | |
| parent | 40a78e6865794db16988bf92a99f69c88c152c8a (diff) | |
| download | RodeoKit-9eaee25e671d47dcb7a2cbb333e6d3283401087f.tar.gz RodeoKit-9eaee25e671d47dcb7a2cbb333e6d3283401087f.zip | |
resizeable desktop window
Diffstat (limited to 'src/input/rodeo_input.c')
| -rw-r--r-- | src/input/rodeo_input.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/input/rodeo_input.c b/src/input/rodeo_input.c index 158fa79..f6f0d9f 100644 --- a/src/input/rodeo_input.c +++ b/src/input/rodeo_input.c @@ -4,9 +4,15 @@ #include "rodeo/input.h" #include "irodeo_input_t.h" #include "rodeo/log.h" +// pirvate +#include "rodeo_internal.h" // -- external -- #include "SDL.h" +#include "bgfx/c99/bgfx.h" + +// -- system -- +#include <inttypes.h> static irodeo_input_state_t istate = {0}; @@ -22,7 +28,34 @@ rodeo_input_events_poll(void) { return true; } - break; + //break; + case SDL_WINDOWEVENT: + { + if(SDL_WINDOWEVENT_SIZE_CHANGED == event.window.event) + { + int32_t width = event.window.data1; + int32_t height = event.window.data2; + //SDL_GetWindowSize(irodeo_window_get(), &width, &height); + bgfx_reset((uint32_t)width, (uint32_t)height, + //BGFX_RESET_MSAA_X16 | BGFX_RESET_MAXANISOTROPY, + BGFX_RESET_VSYNC, + BGFX_TEXTURE_FORMAT_COUNT + ); + irodeo_screen_width_set((uint16_t)width); + irodeo_screen_height_set((uint16_t)height); + rodeo_log( + rodeo_logLevel_warning, + "%"PRIu16"x", + rodeo_screen_width_get() + ); + rodeo_log( + rodeo_logLevel_warning, + "%"PRIu16"\n", + rodeo_screen_height_get() + ); + } + } + // keep going, to check for inputs // - Binary - case SDL_KEYUP: case SDL_KEYDOWN: |
