From 559c7ceb4d08b2412919dc628ba7df81703c8200 Mon Sep 17 00:00:00 2001 From: Ronald Kinard Date: Thu, 20 Mar 2014 02:14:03 -0500 Subject: [PATCH] sdl2: aspect correction in fullscreen, clear on blit --- src/sdl2/i_video.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sdl2/i_video.c b/src/sdl2/i_video.c index 5cb51bb7b..3df42103e 100644 --- a/src/sdl2/i_video.c +++ b/src/sdl2/i_video.c @@ -214,6 +214,8 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); } + SDL_RenderSetLogicalSize(renderer, width, height); + // Set up Texture realwidth = width; realheight = height; @@ -1313,6 +1315,7 @@ void I_FinishUpdate(void) #endif // Blit buffer to texture + SDL_RenderClear(renderer); SDL_RenderCopy(renderer, texture, NULL, NULL); SDL_RenderPresent(renderer); } @@ -1685,6 +1688,8 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) window = SDL_CreateWindow("SRB2", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, BASEVIDWIDTH, BASEVIDHEIGHT, flags); renderer = SDL_CreateRenderer(window, -1, 0); + + SDL_RenderSetLogicalSize(renderer, BASEVIDWIDTH, BASEVIDHEIGHT); return SDL_TRUE; }