all repos — mgba @ 4fb42d58b6c71969bb46b58dfe20b2d900834900

mGBA Game Boy Advance Emulator

Clean up setting up vsync on SDL port
Jeffrey Pfau jeffrey@endrift.com
Mon, 01 Sep 2014 00:51:45 -0700
commit

4fb42d58b6c71969bb46b58dfe20b2d900834900

parent

2c5fd6acd50ba88b0a434a1b35e55c15ec86d445

1 files changed, 2 insertions(+), 7 deletions(-)

jump to
M src/platform/sdl/gl-main.csrc/platform/sdl/gl-main.c

@@ -121,13 +121,6 @@ if (SDL_Init(SDL_INIT_VIDEO) < 0) {

return 0; } - -#if SDL_VERSION_ATLEAST(2, 0, 0) - SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); -#else - SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); -#endif - #ifndef COLOR_16_BIT SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);

@@ -145,9 +138,11 @@

#if SDL_VERSION_ATLEAST(2, 0, 0) renderer->window = SDL_CreateWindow(PROJECT_NAME, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, renderer->viewportWidth, renderer->viewportHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | (SDL_WINDOW_FULLSCREEN_DESKTOP * renderer->events.fullscreen)); SDL_GL_CreateContext(renderer->window); + SDL_GL_SetSwapInterval(1); SDL_GetWindowSize(renderer->window, &renderer->viewportWidth, &renderer->viewportHeight); renderer->events.window = renderer->window; #else + SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); #ifdef COLOR_16_BIT SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 16, SDL_OPENGL); #else