Store rotated content size

This avoids to compute it every time from the frame size.
This commit is contained in:
Romain Vimont
2020-04-08 14:11:23 +02:00
parent c1ebea26e6
commit f3fba3c4b9
2 changed files with 15 additions and 14 deletions

View File

@@ -17,6 +17,7 @@ struct screen {
SDL_Renderer *renderer;
SDL_Texture *texture;
struct size frame_size;
struct size content_size; // rotated frame_size
// The window size the last time it was not maximized or fullscreen.
struct size windowed_window_size;
// Since we receive the event SIZE_CHANGED before MAXIMIZED, we must be
@@ -35,7 +36,11 @@ struct screen {
.renderer = NULL, \
.texture = NULL, \
.frame_size = { \
.width = 0, \
.width = 0, \
.height = 0, \
}, \
.content_size = { \
.width = 0, \
.height = 0, \
}, \
.windowed_window_size = { \