diff options
| author | realtradam <[email protected]> | 2023-06-11 01:21:17 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-06-11 01:21:17 -0400 |
| commit | c7381b27a58744e1b7d8aa3fe2e21514fd11b5b4 (patch) | |
| tree | 8b793adcf837ebc9d67ec36b91cbde6ae4f5f4aa /src/window | |
| parent | f1d321f054b1da072e9c965c20f45399c00af1c0 (diff) | |
| download | RodeoKit-c7381b27a58744e1b7d8aa3fe2e21514fd11b5b4.tar.gz RodeoKit-c7381b27a58744e1b7d8aa3fe2e21514fd11b5b4.zip | |
partial working mouse with letterboxing
Diffstat (limited to 'src/window')
| -rw-r--r-- | src/window/irodeo_window.h | 5 | ||||
| -rw-r--r-- | src/window/irodeo_window_t.h | 4 | ||||
| -rw-r--r-- | src/window/rodeo_window.c | 42 |
3 files changed, 18 insertions, 33 deletions
diff --git a/src/window/irodeo_window.h b/src/window/irodeo_window.h index f0c02e2..23600b8 100644 --- a/src/window/irodeo_window.h +++ b/src/window/irodeo_window.h @@ -15,10 +15,7 @@ SDL_Surface * irodeo_window_surface_get(void); void -irodeo_window_screen_width_setVar(uint16_t width); - -void -irodeo_window_screen_height_setVar(uint16_t height); +irodeo_window_dimensions_update(void); SDL_Window * irodeo_window_get(void); diff --git a/src/window/irodeo_window_t.h b/src/window/irodeo_window_t.h index f7e0c26..3ff4d6c 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; - uint32_t screen_width; - uint32_t screen_height; + uint32_t width; + uint32_t height; bool quit; } irodeo_window_state_t; diff --git a/src/window/rodeo_window.c b/src/window/rodeo_window.c index e92382e..59c7c18 100644 --- a/src/window/rodeo_window.c +++ b/src/window/rodeo_window.c @@ -14,15 +14,15 @@ static irodeo_window_state_t irodeo_window_state = {0}; void rodeo_window_init( - uint16_t screen_height, - uint16_t screen_width, + uint16_t width, + uint16_t height, cstr title ) { irodeo_window_state.window = NULL; irodeo_window_state.screen_surface = NULL; - irodeo_window_state.screen_height = screen_height; - irodeo_window_state.screen_width = screen_width; + irodeo_window_state.height = height; + irodeo_window_state.width = width; rodeo_log( rodeo_logLevel_info, @@ -58,8 +58,8 @@ rodeo_window_init( cstr_str(&title), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, - screen_width, - screen_height, + width, + height, SDL_WINDOW_SHOWN //| SDL_WINDOW_RESIZABLE ); if(irodeo_window_state.window == NULL) @@ -110,7 +110,7 @@ rodeo_window_deinit(void) } void -irodeo_window_update_screen_size(void) +irodeo_window_dimensions_update(void) { int32_t width = 0; int32_t height = 0; @@ -119,34 +119,22 @@ irodeo_window_update_screen_size(void) &width, &height ); - irodeo_window_state.screen_width = (uint32_t)width; - irodeo_window_state.screen_height = (uint32_t)height; + irodeo_window_state.width = (uint32_t)width; + irodeo_window_state.height = (uint32_t)height; } uint32_t -rodeo_window_screen_width_get(void) +rodeo_window_width_get(void) { - irodeo_window_update_screen_size(); - return irodeo_window_state.screen_width; + //irodeo_window_update_screen_size(); + return irodeo_window_state.width; } uint32_t -rodeo_window_screen_height_get(void) +rodeo_window_height_get(void) { - irodeo_window_update_screen_size(); - return irodeo_window_state.screen_height; -} - -void -irodeo_window_screen_width_setVar(uint16_t width) -{ - irodeo_window_state.screen_width = width; -} - -void -irodeo_window_screen_height_setVar(uint16_t height) -{ - irodeo_window_state.screen_height = height; + //irodeo_window_update_screen_size(); + return irodeo_window_state.height; } bool |
