diff options
| author | realtradam <[email protected]> | 2023-06-07 00:50:58 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-06-07 00:50:58 -0400 |
| commit | f1d321f054b1da072e9c965c20f45399c00af1c0 (patch) | |
| tree | b3e287403213207a5c5ced4dd8b7c16d30564856 /src/window | |
| parent | d518023bb61dec8dd776e5cf7b2b23e66b2cdfdb (diff) | |
| download | RodeoKit-f1d321f054b1da072e9c965c20f45399c00af1c0.tar.gz RodeoKit-f1d321f054b1da072e9c965c20f45399c00af1c0.zip | |
add letterboxing matrix
Diffstat (limited to 'src/window')
| -rw-r--r-- | src/window/irodeo_window_t.h | 4 | ||||
| -rw-r--r-- | src/window/rodeo_window.c | 21 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/window/irodeo_window_t.h b/src/window/irodeo_window_t.h index e2dd0a4..f7e0c26 100644 --- a/src/window/irodeo_window_t.h +++ b/src/window/irodeo_window_t.h @@ -14,8 +14,8 @@ struct SDL_Window* window; SDL_Surface* screen_surface; SDL_SysWMinfo wmi; - uint16_t screen_width; - uint16_t screen_height; + uint32_t screen_width; + uint32_t screen_height; bool quit; } irodeo_window_state_t; diff --git a/src/window/rodeo_window.c b/src/window/rodeo_window.c index c7c4ddf..e92382e 100644 --- a/src/window/rodeo_window.c +++ b/src/window/rodeo_window.c @@ -100,7 +100,6 @@ rodeo_window_init( "Success getting driver specific information" ); #endif - } void @@ -110,15 +109,31 @@ rodeo_window_deinit(void) SDL_Quit(); } -uint16_t +void +irodeo_window_update_screen_size(void) +{ + int32_t width = 0; + int32_t height = 0; + SDL_GetWindowSize( + irodeo_window_state.window, + &width, + &height + ); + irodeo_window_state.screen_width = (uint32_t)width; + irodeo_window_state.screen_height = (uint32_t)height; +} + +uint32_t rodeo_window_screen_width_get(void) { + irodeo_window_update_screen_size(); return irodeo_window_state.screen_width; } -uint16_t +uint32_t rodeo_window_screen_height_get(void) { + irodeo_window_update_screen_size(); return irodeo_window_state.screen_height; } |
