diff options
author | Dave Parks <davep@lindenlab.com> | 2011-10-14 17:56:55 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-10-14 17:56:55 -0500 |
commit | 984feefbecd0338618ea499dc1fa44c5a5fe747d (patch) | |
tree | 2114f73857009a983ca7b1ce90e2bf36237c57b9 /indra/llwindow | |
parent | 94c137d5c970bc01e3a4dbe8de6a7104085e5ba6 (diff) | |
parent | baa0ff7d3e34053a1dbc8c5207fe899d9e201ee0 (diff) |
merge
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindowmacosx.cpp | 1 | ||||
-rw-r--r-- | indra/llwindow/llwindowsdl.cpp | 1 | ||||
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 36 |
3 files changed, 32 insertions, 6 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 4dd11541b9..cb2abc5bc0 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1266,7 +1266,6 @@ BOOL LLWindowMacOSX::setSize(const LLCoordScreen size) void LLWindowMacOSX::swapBuffers() { - glFinish(); aglSwapBuffers(mContext); } diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index e41aa9820f..91689f54fd 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -985,7 +985,6 @@ void LLWindowSDL::swapBuffers() { if (mWindow) { - glFinish(); SDL_GL_SwapBuffers(); } } diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 121c7880df..bac23279cc 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -41,6 +41,7 @@ #include "llgl.h" #include "llstring.h" #include "lldir.h" +#include "llglslshader.h" // System includes #include <commdlg.h> @@ -1121,7 +1122,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO } gGLManager.initWGL(); - + if (wglChoosePixelFormatARB) { // OK, at this point, use the ARB wglChoosePixelFormatsARB function to see if we @@ -1378,7 +1379,35 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO return FALSE; } - if (!(mhRC = wglCreateContext(mhDC))) + mhRC = 0; + if (wglCreateContextAttribsARB) + { //attempt to create a non-compatibility profile context + S32 attribs[] = + { + WGL_CONTEXT_MAJOR_VERSION_ARB, 4, + WGL_CONTEXT_MINOR_VERSION_ARB, 0, + WGL_CONTEXT_PROFILE_MASK_ARB, LLRender::sGLCoreProfile ? WGL_CONTEXT_CORE_PROFILE_BIT_ARB : WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, + WGL_CONTEXT_FLAGS_ARB, gDebugGL ? WGL_CONTEXT_DEBUG_BIT_ARB : 0, + 0 + }; + + mhRC = wglCreateContextAttribsARB(mhDC, mhRC, attribs); + + if (!mhRC) + { + attribs[1] = 3; + attribs[3] = 3; + + mhRC = wglCreateContextAttribsARB(mhDC, mhRC, attribs); + } + + if (mhRC) + { //success, disable fixed function calls + LLGLSLShader::sNoFixedFunction = true; + } + } + + if (!mhRC && !(mhRC = wglCreateContext(mhDC))) { close(); OSMessageBox(mCallbacks->translateString("MBGLContextErr"), mCallbacks->translateString("MBError"), OSMB_OK); @@ -1398,7 +1427,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO OSMessageBox(mCallbacks->translateString("MBVideoDrvErr"), mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } - + // Disable vertical sync for swap if (disable_vsync && wglSwapIntervalEXT) { @@ -2896,7 +2925,6 @@ BOOL LLWindowWin32::resetDisplayResolution() void LLWindowWin32::swapBuffers() { - glFinish(); SwapBuffers(mhDC); } |