diff options
author | Dave Parks <davep@lindenlab.com> | 2011-09-26 19:27:10 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-09-26 19:27:10 -0500 |
commit | bd02cdc75f1c752a127d1303527be3a96479af93 (patch) | |
tree | d8503b7c296a4cd4f1aa2954c03ff250beda4254 /indra/llwindow/llwindowwin32.cpp | |
parent | d475a96e94be90e68cf34bf6c25d8ab259aa47b5 (diff) | |
parent | 8dbfa022778f2a7fcd5d2b527045724551279412 (diff) |
merge
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 121c7880df..e4e5256ae7 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) { |