sdl: swap at vsync interval for open gl
This commit is contained in:
parent
d11055cef2
commit
098be9c69e
|
@ -77,6 +77,13 @@ bool SDLGLGraphicsContext::Init()
|
||||||
INFO_LOG(RENDERER, "Created SDL Window and GL Context successfully");
|
INFO_LOG(RENDERER, "Created SDL Window and GL Context successfully");
|
||||||
|
|
||||||
SDL_GL_MakeCurrent(window, glcontext);
|
SDL_GL_MakeCurrent(window, glcontext);
|
||||||
|
#ifndef TEST_AUTOMATION
|
||||||
|
// Swap at vsync
|
||||||
|
SDL_GL_SetSwapInterval(1);
|
||||||
|
#else
|
||||||
|
// Swap immediately
|
||||||
|
SDL_GL_SetSwapInterval(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef GLES
|
#ifdef GLES
|
||||||
load_gles_symbols();
|
load_gles_symbols();
|
||||||
|
@ -94,6 +101,9 @@ bool SDLGLGraphicsContext::Init()
|
||||||
|
|
||||||
void SDLGLGraphicsContext::Swap()
|
void SDLGLGraphicsContext::Swap()
|
||||||
{
|
{
|
||||||
|
#ifdef TEST_AUTOMATION
|
||||||
|
do_swap_automation();
|
||||||
|
#endif
|
||||||
SDL_GL_SwapWindow(window);
|
SDL_GL_SwapWindow(window);
|
||||||
|
|
||||||
/* Check if drawable has been resized */
|
/* Check if drawable has been resized */
|
||||||
|
|
Loading…
Reference in New Issue