diff options
author | Dave Parks <davep@lindenlab.com> | 2014-02-27 17:49:50 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2014-02-27 17:49:50 -0600 |
commit | a8e22e11c5d26b3cdfa2d67919fdde8272d52ea4 (patch) | |
tree | d37551dbfb1ae24ae73409848faa6416e70272d5 /indra/llwindow | |
parent | bfe520387ed3061ba55ea2e58c565016e7a3159e (diff) |
MAINT-2980 Rename "Texture Memory" to "Video Memory" in hardware floater and increase limit.
Limit should be however much vram is installed, but underneath the hood, fudge
how much memory is used for textures to avoid swapping.
Also, catch exceptions when attempting to build a GL context on windows and
display an error dialog instead of crashing.
Diffstat (limited to 'indra/llwindow')
-rwxr-xr-x | indra/llwindow/llwindowwin32.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 30f5526500..767676b9b8 100755 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -85,6 +85,18 @@ void show_window_creation_error(const std::string& title) LL_WARNS("Window") << title << LL_ENDL; } +HGLRC SafeCreateContext(HDC hdc) +{ + __try + { + return wglCreateContext(hdc); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + return NULL; + } +} + //static BOOL LLWindowWin32::sIsClassRegistered = FALSE; @@ -1166,14 +1178,15 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO return FALSE; } - if (!(mhRC = wglCreateContext(mhDC))) + + if (!(mhRC = SafeCreateContext(mhDC))) { close(); OSMessageBox(mCallbacks->translateString("MBGLContextErr"), mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } - + if (!wglMakeCurrent(mhDC, mhRC)) { close(); |