aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llwindow/llwindowwin32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llwindow/llwindowwin32.cpp')
-rw-r--r--linden/indra/llwindow/llwindowwin32.cpp60
1 files changed, 46 insertions, 14 deletions
diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp
index a9c7758..b2826c8 100644
--- a/linden/indra/llwindow/llwindowwin32.cpp
+++ b/linden/indra/llwindow/llwindowwin32.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -372,6 +373,8 @@ LLWindowWin32::LLWindowWin32(const std::string& title, const std::string& name,
372 mMousePositionModified = FALSE; 373 mMousePositionModified = FALSE;
373 mInputProcessingPaused = FALSE; 374 mInputProcessingPaused = FALSE;
374 mPreeditor = NULL; 375 mPreeditor = NULL;
376 mhDC = NULL;
377 mhRC = NULL;
375 378
376 // Initialize the keyboard 379 // Initialize the keyboard
377 gKeyboard = new LLKeyboardWin32(); 380 gKeyboard = new LLKeyboardWin32();
@@ -417,7 +420,7 @@ LLWindowWin32::LLWindowWin32(const std::string& title, const std::string& name,
417 mhInstance = GetModuleHandle(NULL); 420 mhInstance = GetModuleHandle(NULL);
418 mWndProc = NULL; 421 mWndProc = NULL;
419 422
420 mSwapMethod = SWAP_METHOD_EXCHANGE; 423 mSwapMethod = SWAP_METHOD_UNDEFINED;
421 424
422 // No WPARAM yet. 425 // No WPARAM yet.
423 mLastSizeWParam = 0; 426 mLastSizeWParam = 0;
@@ -843,8 +846,13 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
843 RECT window_rect; 846 RECT window_rect;
844 S32 width = size.mX; 847 S32 width = size.mX;
845 S32 height = size.mY; 848 S32 height = size.mY;
849 BOOL auto_show = FALSE;
846 850
847 resetDisplayResolution(); 851 if (mhRC)
852 {
853 auto_show = TRUE;
854 resetDisplayResolution();
855 }
848 856
849 if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode)) 857 if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode))
850 { 858 {
@@ -1182,8 +1190,28 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
1182 LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL; 1190 LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL;
1183 } 1191 }
1184 1192
1185 pixel_format = pixel_formats[0]; 1193
1194
1195 S32 swap_method = 0;
1196 S32 cur_format = num_formats-1;
1197 GLint swap_query = WGL_SWAP_METHOD_ARB;
1198
1199 BOOL found_format = FALSE;
1186 1200
1201 while (!found_format && wglGetPixelFormatAttribivARB(mhDC, pixel_format, 0, 1, &swap_query, &swap_method))
1202 {
1203 if (swap_method == WGL_SWAP_UNDEFINED_ARB || cur_format <= 0)
1204 {
1205 found_format = TRUE;
1206 }
1207 else
1208 {
1209 --cur_format;
1210 }
1211 }
1212
1213 pixel_format = pixel_formats[cur_format];
1214
1187 if (mhDC != 0) // Does The Window Have A Device Context? 1215 if (mhDC != 0) // Does The Window Have A Device Context?
1188 { 1216 {
1189 wglMakeCurrent(mhDC, 0); // Set The Current Active Rendering Context To Zero 1217 wglMakeCurrent(mhDC, 0); // Set The Current Active Rendering Context To Zero
@@ -1226,9 +1254,6 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
1226 return FALSE; 1254 return FALSE;
1227 } 1255 }
1228 1256
1229 int swap_method = 0;
1230 GLint swap_query = WGL_SWAP_METHOD_ARB;
1231
1232 if (wglGetPixelFormatAttribivARB(mhDC, pixel_format, 0, 1, &swap_query, &swap_method)) 1257 if (wglGetPixelFormatAttribivARB(mhDC, pixel_format, 0, 1, &swap_query, &swap_method))
1233 { 1258 {
1234 switch (swap_method) 1259 switch (swap_method)
@@ -1341,13 +1366,21 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
1341 } 1366 }
1342 1367
1343 SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this); 1368 SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this);
1344 show(); 1369
1345
1346 //register joystick timer callback 1370 //register joystick timer callback
1347 SetTimer( mWindowHandle, 0, 1000 / 30, NULL ); // 30 fps timer 1371 SetTimer( mWindowHandle, 0, 1000 / 30, NULL ); // 30 fps timer
1348 1372
1349 // ok to post quit messages now 1373 // ok to post quit messages now
1350 mPostQuit = TRUE; 1374 mPostQuit = TRUE;
1375
1376 if (auto_show)
1377 {
1378 show();
1379 glClearColor(0.0f, 0.0f, 0.0f, 0.f);
1380 glClear(GL_COLOR_BUFFER_BIT);
1381 swapBuffers();
1382 }
1383
1351 return TRUE; 1384 return TRUE;
1352} 1385}
1353 1386
@@ -2942,7 +2975,7 @@ void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url )
2942 /* 2975 /*
2943 std::string reg_path_str = gURLProtocolWhitelistHandler[i] + "\\shell\\open\\command"; 2976 std::string reg_path_str = gURLProtocolWhitelistHandler[i] + "\\shell\\open\\command";
2944 WCHAR reg_path_wstr[256]; 2977 WCHAR reg_path_wstr[256];
2945 mbstowcs(reg_path_wstr, reg_path_str.c_str(), sizeof(reg_path_wstr)/sizeof(reg_path_wstr[0])); 2978 mbstowcs( reg_path_wstr, reg_path_str.c_str(), LL_ARRAY_SIZE(reg_path_wstr) );
2946 2979
2947 HKEY key; 2980 HKEY key;
2948 WCHAR browser_open_wstr[1024]; 2981 WCHAR browser_open_wstr[1024];
@@ -3633,11 +3666,10 @@ BOOL LLWindowWin32::handleImeRequests(U32 request, U32 param, LRESULT *result)
3633} 3666}
3634 3667
3635//static 3668//static
3636std::string LLWindowWin32::getFontListSans() 3669std::vector<std::string> LLWindowWin32::getDynamicFallbackFontList()
3637{ 3670{
3638 // Lists Japanese, Korean, and Chinese sanserif fonts available in 3671 // Fonts previously in getFontListSans() have moved to fonts.xml.
3639 // Windows XP and Vista, as well as "Arial Unicode MS". 3672 return std::vector<std::string>();
3640 return "MSGOTHIC.TTC;gulim.ttc;simhei.ttf;ArialUni.ttf";
3641} 3673}
3642 3674
3643 3675