diff options
author | Dave Parks <davep@lindenlab.com> | 2011-09-20 03:34:09 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-09-20 03:34:09 -0500 |
commit | 66acb932ba7bbd7fecbe78a34e753b5aab2d2104 (patch) | |
tree | 87ae87b36d20082008feeb7c46c38d2d6d498332 /indra/llwindow | |
parent | 9ea41c8094695365bc7ea10165ffd54cda204e88 (diff) |
SH-2244 Add "RenderGLCoreProfile" debug setting that allows the viewer to start with a non-compatibility-profile OpenGL context.
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 1239e2d40b..2ba14f8f6e 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1122,6 +1122,34 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO gGLManager.initWGL(); + if (wglCreateContextAttribsARB && LLRender::sGLCoreProfile) + { + S32 attribs[] = + { + WGL_CONTEXT_MAJOR_VERSION_ARB, 4, + WGL_CONTEXT_MINOR_VERSION_ARB, 0, + WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB, + 0 + }; + + HGLRC res = wglCreateContextAttribsARB(mhDC, mhRC, attribs); + + if (!res) + { + attribs[1] = 3; + attribs[3] = 1; + + res = wglCreateContextAttribsARB(mhDC, mhRC, attribs); + } + + if (res) + { + wglMakeCurrent(mhDC, res); + wglDeleteContext(mhRC); + mhRC = res; + } + } + if (wglChoosePixelFormatARB) { // OK, at this point, use the ARB wglChoosePixelFormatsARB function to see if we |