sdl2: aspect correction in fullscreen, clear on blit

This commit is contained in:
Ronald Kinard 2014-03-20 02:14:03 -05:00
parent 3b137d094a
commit 559c7ceb4d
1 changed files with 5 additions and 0 deletions

View File

@ -214,6 +214,8 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
} }
SDL_RenderSetLogicalSize(renderer, width, height);
// Set up Texture // Set up Texture
realwidth = width; realwidth = width;
realheight = height; realheight = height;
@ -1313,6 +1315,7 @@ void I_FinishUpdate(void)
#endif #endif
// Blit buffer to texture // Blit buffer to texture
SDL_RenderClear(renderer);
SDL_RenderCopy(renderer, texture, NULL, NULL); SDL_RenderCopy(renderer, texture, NULL, NULL);
SDL_RenderPresent(renderer); 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, window = SDL_CreateWindow("SRB2", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
BASEVIDWIDTH, BASEVIDHEIGHT, flags); BASEVIDWIDTH, BASEVIDHEIGHT, flags);
renderer = SDL_CreateRenderer(window, -1, 0); renderer = SDL_CreateRenderer(window, -1, 0);
SDL_RenderSetLogicalSize(renderer, BASEVIDWIDTH, BASEVIDHEIGHT);
return SDL_TRUE; return SDL_TRUE;
} }