Merge branch 'master' of git://github.com/lkalif/SingularityViewer
This commit is contained in:
@@ -235,8 +235,6 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
|
||||
// Create the GL context and set it up for windowed or fullscreen, as appropriate.
|
||||
if(createContext(x, y, width, height, 32, fullscreen, vsync_mode))
|
||||
{
|
||||
gGLManager.initGL();
|
||||
|
||||
//start with arrow cursor
|
||||
initCursors();
|
||||
setCursor( UI_CURSOR_ARROW );
|
||||
@@ -721,9 +719,11 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
||||
}
|
||||
#endif // LL_X11
|
||||
|
||||
gGLManager.initGL();
|
||||
|
||||
#if SDL_VERSION_ATLEAST(1,3,0)
|
||||
// Disable vertical sync for swap
|
||||
if (vsync_mode == 0)
|
||||
if (vsync_mode == 0 || (!gGLManager.mHasAdaptiveVsync && vsync_mode == -1))
|
||||
{
|
||||
LL_DEBUGS("Window") << "Disabling vertical sync" << LL_ENDL;
|
||||
SDL_GL_SetSwapInterval(0);
|
||||
@@ -744,20 +744,11 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
||||
}
|
||||
#else // SDL_VERSION_ATLEAST(1,3,0)
|
||||
#ifdef SDL_GL_SWAP_CONTROL
|
||||
if (vsync_mode == 0)
|
||||
if (vsync_mode <= 0)
|
||||
{
|
||||
LL_DEBUGS("Window") << "Disabling vertical sync" << LL_ENDL;
|
||||
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0);
|
||||
}
|
||||
else if(vsync_mode == -1)
|
||||
{
|
||||
LL_DEBUGS("Window") << "Enabling adaptive vertical sync" << LL_ENDL;
|
||||
if(SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, -1) == -1)
|
||||
{
|
||||
LL_DEBUGS("Window") << "Failed to enable adaptive vertical sync. Disabling vsync." << LL_ENDL;
|
||||
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("Window") << "Enabling vertical sync" << LL_ENDL;
|
||||
@@ -793,8 +784,6 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, cons
|
||||
result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, vsync_mode);
|
||||
if (result)
|
||||
{
|
||||
gGLManager.initGL();
|
||||
|
||||
//start with arrow cursor
|
||||
initCursors();
|
||||
setCursor( UI_CURSOR_ARROW );
|
||||
|
||||
@@ -1652,7 +1652,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
// Disable vertical sync for swap
|
||||
if(wglSwapIntervalEXT)
|
||||
{
|
||||
if (vsync_mode == 0)
|
||||
if (vsync_mode == 0 || (!gGLManager.mHasAdaptiveVsync && vsync_mode == -1))
|
||||
{
|
||||
LL_INFOS("Window") << "Disabling vertical sync" << LL_ENDL;
|
||||
wglSwapIntervalEXT(0);
|
||||
|
||||
Reference in New Issue
Block a user