MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / setVSync

Function setVSync

Engine/source/platformSDL/sdlPlatformGL.cpp:73–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 }
72
73 void setVSync(const int i)
74 {
75 PRESERVE_FRAMEBUFFER();
76 // Nvidia needs to have the default framebuffer bound or the vsync calls fail
77 glBindFramebuffer(GL_FRAMEBUFFER, 0);
78 if( i == 1 || i == -1 )
79 {
80 int ret = SDL_GL_SetSwapInterval(-1);
81
82 if( ret == -1)
83 SDL_GL_SetSwapInterval(1);
84 }
85 else
86 SDL_GL_SetSwapInterval(0);
87
88 }
89
90}

Callers 2

initGLStateMethod · 0.85
vsyncCallbackMethod · 0.85

Calls 1

SDL_GL_SetSwapIntervalFunction · 0.85

Tested by

no test coverage detected