From a8e22e11c5d26b3cdfa2d67919fdde8272d52ea4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 27 Feb 2014 17:49:50 -0600 Subject: 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. --- indra/llwindow/llwindowwin32.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'indra/llwindow') 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(); -- cgit v1.2.3