Skip to content

Commit 3b3971d

Browse files
committed
Create initial window at 80% size of screen to fix aspect ratio.
If you ask SDL2 to create a window of exactly the size of the screen, it appears to shrink your request down a little bit to make room for the window title bar and borders, which messes with the aspect ratio of the area you can draw in. If we shrink our request down so the borders and title bar can fit, then our initial aspect ratio isn't messed up. Signed-off-by: Stephen M. Cameron <stephenmcameron@gmail.com>
1 parent 41236f2 commit 3b3971d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

snis_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25859,7 +25859,7 @@ int main(int argc, char *argv[])
2585925859
SDL_GLContext gl_context = SDL_GL_CreateContext(window);
2586025860
(void) gl_context;
2586125861
setup_screen_parameters(window);
25862-
SDL_SetWindowSize(window, SCREEN_WIDTH, SCREEN_HEIGHT);
25862+
SDL_SetWindowSize(window, (int) (0.8 * SCREEN_WIDTH), (int) (0.8 * SCREEN_HEIGHT));
2586325863
window_manager_can_constrain_aspect_ratio =
2586425864
(constrain_aspect_ratio_via_xlib(window, SCREEN_WIDTH, SCREEN_HEIGHT) == 0);
2586525865
init_colors();

0 commit comments

Comments
 (0)