diff options
Diffstat (limited to 'linden/indra/llwindow')
-rw-r--r-- | linden/indra/llwindow/files.linux.lst | 1 | ||||
-rw-r--r-- | linden/indra/llwindow/files.sunos5.lst | 1 | ||||
-rw-r--r-- | linden/indra/llwindow/lldxhardware.cpp | 21 | ||||
-rw-r--r-- | linden/indra/llwindow/llgl.cpp | 294 | ||||
-rw-r--r-- | linden/indra/llwindow/llgl.h | 30 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindow.cpp | 20 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindow.h | 2 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowlinux.cpp | 61 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowlinux.h | 119 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowmacosx-objc.mm | 8 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowmacosx.cpp | 71 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowmacosx.h | 2 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowsdl.cpp | 98 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowsdl.h | 3 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowsolaris.cpp | 61 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowsolaris.h | 121 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowwin32.cpp | 133 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowwin32.h | 2 |
18 files changed, 404 insertions, 644 deletions
diff --git a/linden/indra/llwindow/files.linux.lst b/linden/indra/llwindow/files.linux.lst index e41ac2a..a2dfa07 100644 --- a/linden/indra/llwindow/files.linux.lst +++ b/linden/indra/llwindow/files.linux.lst | |||
@@ -1,4 +1,3 @@ | |||
1 | llwindow/llkeyboardsdl.cpp | 1 | llwindow/llkeyboardsdl.cpp |
2 | llwindow/llwindowsdl.cpp | 2 | llwindow/llwindowsdl.cpp |
3 | llwindow/llwindowlinux.cpp | ||
4 | llwindow/llwindowmesaheadless.cpp | 3 | llwindow/llwindowmesaheadless.cpp |
diff --git a/linden/indra/llwindow/files.sunos5.lst b/linden/indra/llwindow/files.sunos5.lst index ee20b05..a2dfa07 100644 --- a/linden/indra/llwindow/files.sunos5.lst +++ b/linden/indra/llwindow/files.sunos5.lst | |||
@@ -1,4 +1,3 @@ | |||
1 | llwindow/llkeyboardsdl.cpp | 1 | llwindow/llkeyboardsdl.cpp |
2 | llwindow/llwindowsdl.cpp | 2 | llwindow/llwindowsdl.cpp |
3 | llwindow/llwindowsolaris.cpp | ||
4 | llwindow/llwindowmesaheadless.cpp | 3 | llwindow/llwindowmesaheadless.cpp |
diff --git a/linden/indra/llwindow/lldxhardware.cpp b/linden/indra/llwindow/lldxhardware.cpp index 4eb8cab..c2d94c3 100644 --- a/linden/indra/llwindow/lldxhardware.cpp +++ b/linden/indra/llwindow/lldxhardware.cpp | |||
@@ -304,7 +304,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
304 | IDxDiagContainer *driver_containerp = NULL; | 304 | IDxDiagContainer *driver_containerp = NULL; |
305 | 305 | ||
306 | // CoCreate a IDxDiagProvider* | 306 | // CoCreate a IDxDiagProvider* |
307 | llinfos << "CoCreateInstance IID_IDxDiagProvider" << llendl; | 307 | LL_DEBUGS("AppInit") << "CoCreateInstance IID_IDxDiagProvider" << LL_ENDL; |
308 | hr = CoCreateInstance(CLSID_DxDiagProvider, | 308 | hr = CoCreateInstance(CLSID_DxDiagProvider, |
309 | NULL, | 309 | NULL, |
310 | CLSCTX_INPROC_SERVER, | 310 | CLSCTX_INPROC_SERVER, |
@@ -313,7 +313,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
313 | 313 | ||
314 | if (FAILED(hr)) | 314 | if (FAILED(hr)) |
315 | { | 315 | { |
316 | llwarns << "No DXDiag provider found! DirectX 9 not installed!" << llendl; | 316 | LL_WARNS("AppInit") << "No DXDiag provider found! DirectX 9 not installed!" << LL_ENDL; |
317 | gWriteDebug("No DXDiag provider found! DirectX 9 not installed!\n"); | 317 | gWriteDebug("No DXDiag provider found! DirectX 9 not installed!\n"); |
318 | goto LCleanup; | 318 | goto LCleanup; |
319 | } | 319 | } |
@@ -331,14 +331,14 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
331 | dx_diag_init_params.bAllowWHQLChecks = TRUE; | 331 | dx_diag_init_params.bAllowWHQLChecks = TRUE; |
332 | dx_diag_init_params.pReserved = NULL; | 332 | dx_diag_init_params.pReserved = NULL; |
333 | 333 | ||
334 | llinfos << "dx_diag_providerp->Initialize" << llendl; | 334 | LL_DEBUGS("AppInit") << "dx_diag_providerp->Initialize" << LL_ENDL; |
335 | hr = dx_diag_providerp->Initialize(&dx_diag_init_params); | 335 | hr = dx_diag_providerp->Initialize(&dx_diag_init_params); |
336 | if(FAILED(hr)) | 336 | if(FAILED(hr)) |
337 | { | 337 | { |
338 | goto LCleanup; | 338 | goto LCleanup; |
339 | } | 339 | } |
340 | 340 | ||
341 | llinfos << "dx_diag_providerp->GetRootContainer" << llendl; | 341 | LL_DEBUGS("AppInit") << "dx_diag_providerp->GetRootContainer" << LL_ENDL; |
342 | hr = dx_diag_providerp->GetRootContainer( &dx_diag_rootp ); | 342 | hr = dx_diag_providerp->GetRootContainer( &dx_diag_rootp ); |
343 | if(FAILED(hr) || !dx_diag_rootp) | 343 | if(FAILED(hr) || !dx_diag_rootp) |
344 | { | 344 | { |
@@ -348,7 +348,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
348 | HRESULT hr; | 348 | HRESULT hr; |
349 | 349 | ||
350 | // Get display driver information | 350 | // Get display driver information |
351 | llinfos << "dx_diag_rootp->GetChildContainer" << llendl; | 351 | LL_DEBUGS("AppInit") << "dx_diag_rootp->GetChildContainer" << LL_ENDL; |
352 | hr = dx_diag_rootp->GetChildContainer(L"DxDiag_DisplayDevices", &devices_containerp); | 352 | hr = dx_diag_rootp->GetChildContainer(L"DxDiag_DisplayDevices", &devices_containerp); |
353 | if(FAILED(hr) || !devices_containerp) | 353 | if(FAILED(hr) || !devices_containerp) |
354 | { | 354 | { |
@@ -356,7 +356,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
356 | } | 356 | } |
357 | 357 | ||
358 | // Get device 0 | 358 | // Get device 0 |
359 | llinfos << "devices_containerp->GetChildContainer" << llendl; | 359 | LL_DEBUGS("AppInit") << "devices_containerp->GetChildContainer" << LL_ENDL; |
360 | hr = devices_containerp->GetChildContainer(L"0", &device_containerp); | 360 | hr = devices_containerp->GetChildContainer(L"0", &device_containerp); |
361 | if(FAILED(hr) || !device_containerp) | 361 | if(FAILED(hr) || !device_containerp) |
362 | { | 362 | { |
@@ -373,10 +373,9 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
373 | // Dump the string as an int into the structure | 373 | // Dump the string as an int into the structure |
374 | char *stopstring; | 374 | char *stopstring; |
375 | mVRAM = strtol(ram_str.c_str(), &stopstring, 10); | 375 | mVRAM = strtol(ram_str.c_str(), &stopstring, 10); |
376 | llinfos << "VRAM Detected: " << mVRAM << " DX9 string: " << ram_str << llendl; | 376 | LL_INFOS("AppInit") << "VRAM Detected: " << mVRAM << " DX9 string: " << ram_str << LL_ENDL; |
377 | } | 377 | } |
378 | 378 | ||
379 | |||
380 | if (vram_only) | 379 | if (vram_only) |
381 | { | 380 | { |
382 | ok = TRUE; | 381 | ok = TRUE; |
@@ -393,7 +392,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
393 | // This call may take some time while dxdiag gathers the info. | 392 | // This call may take some time while dxdiag gathers the info. |
394 | DWORD num_devices = 0; | 393 | DWORD num_devices = 0; |
395 | WCHAR wszContainer[256]; | 394 | WCHAR wszContainer[256]; |
396 | llinfos << "dx_diag_rootp->GetChildContainer DxDiag_SystemDevices" << llendl; | 395 | LL_DEBUGS("AppInit") << "dx_diag_rootp->GetChildContainer DxDiag_SystemDevices" << LL_ENDL; |
397 | hr = dx_diag_rootp->GetChildContainer(L"DxDiag_SystemDevices", &system_device_containerp); | 396 | hr = dx_diag_rootp->GetChildContainer(L"DxDiag_SystemDevices", &system_device_containerp); |
398 | if (FAILED(hr)) | 397 | if (FAILED(hr)) |
399 | { | 398 | { |
@@ -406,7 +405,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
406 | goto LCleanup; | 405 | goto LCleanup; |
407 | } | 406 | } |
408 | 407 | ||
409 | llinfos << "DX9 iterating over devices" << llendl; | 408 | LL_DEBUGS("AppInit") << "DX9 iterating over devices" << LL_ENDL; |
410 | S32 device_num = 0; | 409 | S32 device_num = 0; |
411 | for (device_num = 0; device_num < (S32)num_devices; device_num++) | 410 | for (device_num = 0; device_num < (S32)num_devices; device_num++) |
412 | { | 411 | { |
@@ -523,7 +522,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
523 | LCleanup: | 522 | LCleanup: |
524 | if (!ok) | 523 | if (!ok) |
525 | { | 524 | { |
526 | llwarns << "DX9 probe failed" << llendl; | 525 | LL_WARNS("AppInit") << "DX9 probe failed" << LL_ENDL; |
527 | gWriteDebug("DX9 probe failed\n"); | 526 | gWriteDebug("DX9 probe failed\n"); |
528 | } | 527 | } |
529 | 528 | ||
diff --git a/linden/indra/llwindow/llgl.cpp b/linden/indra/llwindow/llgl.cpp index 229fdf2..e8169b6 100644 --- a/linden/indra/llwindow/llgl.cpp +++ b/linden/indra/llwindow/llgl.cpp | |||
@@ -41,7 +41,7 @@ | |||
41 | #include "llsys.h" | 41 | #include "llsys.h" |
42 | 42 | ||
43 | #include "llgl.h" | 43 | #include "llgl.h" |
44 | #include "llglimmediate.h" | 44 | #include "llrender.h" |
45 | 45 | ||
46 | #include "llerror.h" | 46 | #include "llerror.h" |
47 | #include "llquaternion.h" | 47 | #include "llquaternion.h" |
@@ -55,6 +55,7 @@ | |||
55 | //#define GL_STATE_VERIFY | 55 | //#define GL_STATE_VERIFY |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | BOOL gDebugGL = FALSE; | ||
58 | BOOL gClothRipple = FALSE; | 59 | BOOL gClothRipple = FALSE; |
59 | BOOL gNoRender = FALSE; | 60 | BOOL gNoRender = FALSE; |
60 | LLMatrix4 gGLObliqueProjectionInverse; | 61 | LLMatrix4 gGLObliqueProjectionInverse; |
@@ -253,50 +254,50 @@ PFNGLCOLORTABLEEXTPROC glColorTableEXT = NULL; | |||
253 | 254 | ||
254 | LLGLManager gGLManager; | 255 | LLGLManager gGLManager; |
255 | 256 | ||
256 | LLGLManager::LLGLManager() | 257 | LLGLManager::LLGLManager() : |
257 | { | 258 | mInited(FALSE), |
258 | mInited = FALSE; | 259 | mIsDisabled(FALSE), |
259 | mIsDisabled = FALSE; | 260 | |
260 | mHasCubeMap = FALSE; | 261 | mHasMultitexture(FALSE), |
261 | mHasMultitexture = FALSE; | 262 | mNumTextureUnits(1), |
262 | mHasMipMapGeneration = FALSE; | 263 | mHasMipMapGeneration(FALSE), |
263 | mHasAnisotropic = FALSE; | 264 | mHasPalettedTextures(FALSE), |
264 | mHasCompressedTextures = FALSE; | 265 | mHasCompressedTextures(FALSE), |
265 | mHasARBEnvCombine = FALSE; | 266 | mHasFramebufferObject(FALSE), |
266 | mIsGF2or4MX = FALSE; | 267 | |
267 | mIsGF3 = FALSE; | 268 | mHasVertexBufferObject(FALSE), |
268 | mIsGFFX = FALSE; | 269 | mHasPBuffer(FALSE), |
269 | mIsATI = FALSE; | 270 | mHasShaderObjects(FALSE), |
270 | mATIOffsetVerticalLines = FALSE; | 271 | mHasVertexShader(FALSE), |
271 | mHasVertexShader = FALSE; | 272 | mHasFragmentShader(FALSE), |
272 | mHasFragmentShader = FALSE; | 273 | mHasOcclusionQuery(FALSE), |
273 | mHasShaderObjects = FALSE; | 274 | mHasPointParameters(FALSE), |
274 | mHasPointParameters = FALSE; | 275 | |
275 | 276 | mHasAnisotropic(FALSE), | |
276 | #if LL_WINDOWS | 277 | mHasARBEnvCombine(FALSE), |
277 | mHasWGLARBPixelFormat = FALSE; | 278 | mHasCubeMap(FALSE), |
278 | #endif // LL_WINDOWS | 279 | |
279 | 280 | mIsATI(FALSE), | |
280 | #if LL_DARWIN | 281 | mIsNVIDIA(FALSE), |
281 | mHasAPPLEVertexArrayRange = FALSE; | 282 | mIsIntel(FALSE), |
282 | mHasAPPLEFence = FALSE; | 283 | mIsGF2or4MX(FALSE), |
283 | mHasAPPLEVAO = FALSE; | 284 | mIsGF3(FALSE), |
284 | #endif | 285 | mIsGFFX(FALSE), |
285 | 286 | mATIOffsetVerticalLines(FALSE), | |
286 | mIsNVIDIA = FALSE; | 287 | |
287 | mIsIntel = FALSE; | 288 | mHasRequirements(TRUE), |
289 | |||
290 | mHasSeparateSpecularColor(FALSE), | ||
291 | |||
292 | mDriverVersionMajor(1), | ||
293 | mDriverVersionMinor(0), | ||
294 | mDriverVersionRelease(0), | ||
295 | mGLVersion(1.0f), | ||
288 | 296 | ||
289 | mDriverVersionMajor = 1; | 297 | mVRAM(0), |
290 | mDriverVersionMinor = 0; | 298 | mGLMaxVertexRange(0), |
291 | mDriverVersionRelease = 0; | 299 | mGLMaxIndexRange(0) |
292 | mGLVersion = 1.0f; | 300 | { |
293 | |||
294 | mNumTextureUnits = 1; | ||
295 | mVRAM = 0; | ||
296 | mGLMaxVertexRange = 0; | ||
297 | mGLMaxIndexRange = 0; | ||
298 | |||
299 | mHasRequirements = TRUE; | ||
300 | } | 301 | } |
301 | 302 | ||
302 | //--------------------------------------------------------------------- | 303 | //--------------------------------------------------------------------- |
@@ -308,7 +309,7 @@ void LLGLManager::initWGL() | |||
308 | #if LL_WINDOWS && !LL_MESA_HEADLESS | 309 | #if LL_WINDOWS && !LL_MESA_HEADLESS |
309 | if (!glh_init_extensions("WGL_ARB_pixel_format")) | 310 | if (!glh_init_extensions("WGL_ARB_pixel_format")) |
310 | { | 311 | { |
311 | llwarns << "No ARB pixel format extensions" << llendl; | 312 | LL_WARNS("RenderInit") << "No ARB pixel format extensions" << LL_ENDL; |
312 | } | 313 | } |
313 | 314 | ||
314 | if (ExtensionExists("WGL_EXT_swap_control", gGLHExts.mSysExts)) | 315 | if (ExtensionExists("WGL_EXT_swap_control", gGLHExts.mSysExts)) |
@@ -316,15 +317,14 @@ void LLGLManager::initWGL() | |||
316 | GLH_EXT_NAME(wglSwapIntervalEXT) = (PFNWGLSWAPINTERVALEXTPROC)GLH_EXT_GET_PROC_ADDRESS("wglSwapIntervalEXT"); | 317 | GLH_EXT_NAME(wglSwapIntervalEXT) = (PFNWGLSWAPINTERVALEXTPROC)GLH_EXT_GET_PROC_ADDRESS("wglSwapIntervalEXT"); |
317 | } | 318 | } |
318 | 319 | ||
319 | mHasWGLARBPixelFormat = glh_init_extensions("WGL_ARB_pbuffer"); | 320 | if( !glh_init_extensions("WGL_ARB_pbuffer") ) |
320 | if( !mHasWGLARBPixelFormat ) | ||
321 | { | 321 | { |
322 | llwarns << "No ARB WGL PBuffer extensions" << llendl; | 322 | LL_WARNS("RenderInit") << "No ARB WGL PBuffer extensions" << LL_ENDL; |
323 | } | 323 | } |
324 | 324 | ||
325 | if( !glh_init_extensions("WGL_ARB_render_texture") ) | 325 | if( !glh_init_extensions("WGL_ARB_render_texture") ) |
326 | { | 326 | { |
327 | llwarns << "No ARB WGL render texture extensions" << llendl; | 327 | LL_WARNS("RenderInit") << "No ARB WGL render texture extensions" << LL_ENDL; |
328 | } | 328 | } |
329 | 329 | ||
330 | mHasPBuffer = ExtensionExists("WGL_ARB_pbuffer", gGLHExts.mSysExts) && | 330 | mHasPBuffer = ExtensionExists("WGL_ARB_pbuffer", gGLHExts.mSysExts) && |
@@ -338,19 +338,15 @@ bool LLGLManager::initGL() | |||
338 | { | 338 | { |
339 | if (mInited) | 339 | if (mInited) |
340 | { | 340 | { |
341 | llerrs << "Calling init on LLGLManager after already initialized!" << llendl; | 341 | LL_ERRS("RenderInit") << "Calling init on LLGLManager after already initialized!" << LL_ENDL; |
342 | } | 342 | } |
343 | 343 | ||
344 | GLint alpha_bits; | 344 | GLint alpha_bits; |
345 | glGetIntegerv( GL_ALPHA_BITS, &alpha_bits ); | 345 | glGetIntegerv( GL_ALPHA_BITS, &alpha_bits ); |
346 | if( 8 != alpha_bits ) | 346 | if( 8 != alpha_bits ) |
347 | { | 347 | { |
348 | llwarns << "Frame buffer has less than 8 bits of alpha. Avatar texture compositing will fail." << llendl; | 348 | LL_WARNS("RenderInit") << "Frame buffer has less than 8 bits of alpha. Avatar texture compositing will fail." << LL_ENDL; |
349 | } | 349 | } |
350 | |||
351 | // This function uses at least one variable that's initialized below. | ||
352 | // Moved this call down to after we figure out which card we're dealing with. -- MBW 2003.10.07 | ||
353 | // initExtensions(); | ||
354 | 350 | ||
355 | // Extract video card strings and convert to upper case to | 351 | // Extract video card strings and convert to upper case to |
356 | // work around driver-to-driver variation in capitalization. | 352 | // work around driver-to-driver variation in capitalization. |
@@ -445,7 +441,7 @@ bool LLGLManager::initGL() | |||
445 | mHasRequirements = FALSE; | 441 | mHasRequirements = FALSE; |
446 | 442 | ||
447 | // We don't support cards that don't support the GL_ARB_multitexture extension | 443 | // We don't support cards that don't support the GL_ARB_multitexture extension |
448 | llwarns << "GL Drivers do not support GL_ARB_multitexture" << llendl; | 444 | LL_WARNS("RenderInit") << "GL Drivers do not support GL_ARB_multitexture" << LL_ENDL; |
449 | return false; | 445 | return false; |
450 | } | 446 | } |
451 | 447 | ||
@@ -489,6 +485,22 @@ LLString LLGLManager::getGLInfoString() | |||
489 | return info_str; | 485 | return info_str; |
490 | } | 486 | } |
491 | 487 | ||
488 | void LLGLManager::printGLInfoString() | ||
489 | { | ||
490 | LLString info_str; | ||
491 | LLString all_exts, line; | ||
492 | |||
493 | LL_INFOS("RenderInit") << "GL_VENDOR: " << ((const char *)glGetString(GL_VENDOR)) << LL_ENDL; | ||
494 | LL_INFOS("RenderInit") << "GL_RENDERER: " << ((const char *)glGetString(GL_RENDERER)) << LL_ENDL; | ||
495 | LL_INFOS("RenderInit") << "GL_VERSION: " << ((const char *)glGetString(GL_VERSION)) << LL_ENDL; | ||
496 | |||
497 | #if !LL_MESA_HEADLESS | ||
498 | all_exts = (const char *)gGLHExts.mSysExts; | ||
499 | LLString::replaceChar(all_exts, ' ', '\n'); | ||
500 | LL_DEBUGS("RenderInit") << "GL_EXTENSIONS:\n" << all_exts << LL_ENDL; | ||
501 | #endif | ||
502 | } | ||
503 | |||
492 | LLString LLGLManager::getRawGLString() | 504 | LLString LLGLManager::getRawGLString() |
493 | { | 505 | { |
494 | LLString gl_string; | 506 | LLString gl_string; |
@@ -595,8 +607,7 @@ void LLGLManager::initExtensions() | |||
595 | mHasShaderObjects = FALSE; | 607 | mHasShaderObjects = FALSE; |
596 | mHasVertexShader = FALSE; | 608 | mHasVertexShader = FALSE; |
597 | mHasFragmentShader = FALSE; | 609 | mHasFragmentShader = FALSE; |
598 | llwarns << "GL extension support DISABLED via LL_GL_NOEXT" << | 610 | LL_WARNS("RenderInit") << "GL extension support DISABLED via LL_GL_NOEXT" << LL_ENDL; |
599 | llendl; | ||
600 | } | 611 | } |
601 | else if (getenv("LL_GL_BASICEXT")) /* Flawfinder: ignore */ | 612 | else if (getenv("LL_GL_BASICEXT")) /* Flawfinder: ignore */ |
602 | { | 613 | { |
@@ -612,8 +623,7 @@ void LLGLManager::initExtensions() | |||
612 | mHasShaderObjects = FALSE; | 623 | mHasShaderObjects = FALSE; |
613 | mHasVertexShader = FALSE; | 624 | mHasVertexShader = FALSE; |
614 | mHasFragmentShader = FALSE; | 625 | mHasFragmentShader = FALSE; |
615 | llwarns << "GL extension support forced to SIMPLE level via LL_GL_BASICEXT" << | 626 | LL_WARNS("RenderInit") << "GL extension support forced to SIMPLE level via LL_GL_BASICEXT" << LL_ENDL; |
616 | llendl; | ||
617 | } | 627 | } |
618 | if (getenv("LL_GL_BLACKLIST")) /* Flawfinder: ignore */ | 628 | if (getenv("LL_GL_BLACKLIST")) /* Flawfinder: ignore */ |
619 | { | 629 | { |
@@ -621,7 +631,7 @@ void LLGLManager::initExtensions() | |||
621 | // GL extensions to isolate problems with their hardware. | 631 | // GL extensions to isolate problems with their hardware. |
622 | // SL-28126 | 632 | // SL-28126 |
623 | const char *const blacklist = getenv("LL_GL_BLACKLIST"); /* Flawfinder: ignore */ | 633 | const char *const blacklist = getenv("LL_GL_BLACKLIST"); /* Flawfinder: ignore */ |
624 | llwarns << "GL extension support partially disabled via LL_GL_BLACKLIST: " << blacklist << llendl; | 634 | LL_WARNS("RenderInit") << "GL extension support partially disabled via LL_GL_BLACKLIST: " << blacklist << LL_ENDL; |
625 | if (strchr(blacklist,'a')) mHasARBEnvCombine = FALSE; | 635 | if (strchr(blacklist,'a')) mHasARBEnvCombine = FALSE; |
626 | if (strchr(blacklist,'b')) mHasCompressedTextures = FALSE; | 636 | if (strchr(blacklist,'b')) mHasCompressedTextures = FALSE; |
627 | if (strchr(blacklist,'c')) mHasVertexBufferObject = FALSE; | 637 | if (strchr(blacklist,'c')) mHasVertexBufferObject = FALSE; |
@@ -651,62 +661,62 @@ void LLGLManager::initExtensions() | |||
651 | 661 | ||
652 | if (!mHasMultitexture) | 662 | if (!mHasMultitexture) |
653 | { | 663 | { |
654 | llinfos << "Couldn't initialize multitexturing" << llendl; | 664 | LL_INFOS("RenderInit") << "Couldn't initialize multitexturing" << LL_ENDL; |
655 | } | 665 | } |
656 | if (!mHasMipMapGeneration) | 666 | if (!mHasMipMapGeneration) |
657 | { | 667 | { |
658 | llinfos << "Couldn't initialize mipmap generation" << llendl; | 668 | LL_INFOS("RenderInit") << "Couldn't initialize mipmap generation" << LL_ENDL; |
659 | } | 669 | } |
660 | if (!mHasARBEnvCombine) | 670 | if (!mHasARBEnvCombine) |
661 | { | 671 | { |
662 | llinfos << "Couldn't initialize GL_ARB_texture_env_combine" << llendl; | 672 | LL_INFOS("RenderInit") << "Couldn't initialize GL_ARB_texture_env_combine" << LL_ENDL; |
663 | } | 673 | } |
664 | if (!mHasPalettedTextures) | 674 | if (!mHasPalettedTextures) |
665 | { | 675 | { |
666 | llinfos << "Couldn't initialize GL_EXT_paletted_texture" << llendl; | 676 | LL_INFOS("RenderInit") << "Couldn't initialize GL_EXT_paletted_texture" << LL_ENDL; |
667 | } | 677 | } |
668 | if (!mHasSeparateSpecularColor) | 678 | if (!mHasSeparateSpecularColor) |
669 | { | 679 | { |
670 | llinfos << "Couldn't initialize separate specular color" << llendl; | 680 | LL_INFOS("RenderInit") << "Couldn't initialize separate specular color" << LL_ENDL; |
671 | } | 681 | } |
672 | if (!mHasAnisotropic) | 682 | if (!mHasAnisotropic) |
673 | { | 683 | { |
674 | llinfos << "Couldn't initialize anisotropic filtering" << llendl; | 684 | LL_INFOS("RenderInit") << "Couldn't initialize anisotropic filtering" << LL_ENDL; |
675 | } | 685 | } |
676 | if (!mHasCompressedTextures) | 686 | if (!mHasCompressedTextures) |
677 | { | 687 | { |
678 | llinfos << "Couldn't initialize GL_ARB_texture_compression" << llendl; | 688 | LL_INFOS("RenderInit") << "Couldn't initialize GL_ARB_texture_compression" << LL_ENDL; |
679 | } | 689 | } |
680 | if (!mHasOcclusionQuery) | 690 | if (!mHasOcclusionQuery) |
681 | { | 691 | { |
682 | llinfos << "Couldn't initialize GL_ARB_occlusion_query" << llendl; | 692 | LL_INFOS("RenderInit") << "Couldn't initialize GL_ARB_occlusion_query" << LL_ENDL; |
683 | } | 693 | } |
684 | if (!mHasPointParameters) | 694 | if (!mHasPointParameters) |
685 | { | 695 | { |
686 | llinfos << "Couldn't initialize GL_ARB_point_parameters" << llendl; | 696 | LL_INFOS("RenderInit") << "Couldn't initialize GL_ARB_point_parameters" << LL_ENDL; |
687 | } | 697 | } |
688 | if (!mHasShaderObjects) | 698 | if (!mHasShaderObjects) |
689 | { | 699 | { |
690 | llinfos << "Couldn't initialize GL_ARB_shader_objects" << llendl; | 700 | LL_INFOS("RenderInit") << "Couldn't initialize GL_ARB_shader_objects" << LL_ENDL; |
691 | } | 701 | } |
692 | if (!mHasVertexShader) | 702 | if (!mHasVertexShader) |
693 | { | 703 | { |
694 | llinfos << "Couldn't initialize GL_ARB_vertex_shader" << llendl; | 704 | LL_INFOS("RenderInit") << "Couldn't initialize GL_ARB_vertex_shader" << LL_ENDL; |
695 | } | 705 | } |
696 | if (!mHasFragmentShader) | 706 | if (!mHasFragmentShader) |
697 | { | 707 | { |
698 | llinfos << "Couldn't initialize GL_ARB_fragment_shader" << llendl; | 708 | LL_INFOS("RenderInit") << "Couldn't initialize GL_ARB_fragment_shader" << LL_ENDL; |
699 | } | 709 | } |
700 | 710 | ||
701 | // Disable certain things due to known bugs | 711 | // Disable certain things due to known bugs |
702 | if (mIsIntel && mHasMipMapGeneration) | 712 | if (mIsIntel && mHasMipMapGeneration) |
703 | { | 713 | { |
704 | llinfos << "Disabling mip-map generation for Intel GPUs" << llendl; | 714 | LL_INFOS("RenderInit") << "Disabling mip-map generation for Intel GPUs" << LL_ENDL; |
705 | mHasMipMapGeneration = FALSE; | 715 | mHasMipMapGeneration = FALSE; |
706 | } | 716 | } |
707 | if (mIsATI && mHasMipMapGeneration) | 717 | if (mIsATI && mHasMipMapGeneration) |
708 | { | 718 | { |
709 | llinfos << "Disabling mip-map generation for ATI GPUs (performance opt)" << llendl; | 719 | LL_INFOS("RenderInit") << "Disabling mip-map generation for ATI GPUs (performance opt)" << LL_ENDL; |
710 | mHasMipMapGeneration = FALSE; | 720 | mHasMipMapGeneration = FALSE; |
711 | } | 721 | } |
712 | 722 | ||
@@ -714,30 +724,8 @@ void LLGLManager::initExtensions() | |||
714 | glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange); | 724 | glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange); |
715 | glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange); | 725 | glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange); |
716 | 726 | ||
717 | // Apple specific | ||
718 | #if LL_DARWIN | ||
719 | mHasAPPLEVertexArrayRange = glh_init_extensions("GL_APPLE_vertex_array_range"); | ||
720 | if (!mHasAPPLEVertexArrayRange) | ||
721 | { | ||
722 | llinfos << "Couldn't initialize GL_APPLE_vertex_array_range" << llendl; | ||
723 | } | ||
724 | |||
725 | mHasAPPLEFence = glh_init_extensions("GL_APPLE_fence"); | ||
726 | if (!mHasAPPLEFence) | ||
727 | { | ||
728 | llinfos << "Couldn't initialize GL_APPLE_fence" << llendl; | ||
729 | } | ||
730 | |||
731 | mHasAPPLEVAO = glh_init_extensions("GL_APPLE_vertex_array_object"); | ||
732 | if (mHasAPPLEVAO) | ||
733 | { | ||
734 | llinfos << "Has GL_APPLE_vertex_array_object!" << llendl; | ||
735 | } | ||
736 | |||
737 | #endif // LL_DARWIN | ||
738 | |||
739 | #if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS | 727 | #if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS |
740 | llinfos << "GL Probe: Getting symbols" << llendl; | 728 | LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL; |
741 | if (mHasVertexBufferObject) | 729 | if (mHasVertexBufferObject) |
742 | { | 730 | { |
743 | glBindBufferARB = (PFNGLBINDBUFFERARBPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBufferARB"); | 731 | glBindBufferARB = (PFNGLBINDBUFFERARBPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBufferARB"); |
@@ -921,7 +909,7 @@ void LLGLManager::initExtensions() | |||
921 | glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC) GLH_EXT_GET_PROC_ADDRESS("glgetVertexAttribPointervARB"); | 909 | glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC) GLH_EXT_GET_PROC_ADDRESS("glgetVertexAttribPointervARB"); |
922 | glIsProgramARB = (PFNGLISPROGRAMARBPROC) GLH_EXT_GET_PROC_ADDRESS("glIsProgramARB"); | 910 | glIsProgramARB = (PFNGLISPROGRAMARBPROC) GLH_EXT_GET_PROC_ADDRESS("glIsProgramARB"); |
923 | } | 911 | } |
924 | llinfos << "GL Probe: Got symbols" << llendl; | 912 | LL_DEBUGS("RenderInit") << "GL Probe: Got symbols" << LL_ENDL; |
925 | #endif | 913 | #endif |
926 | 914 | ||
927 | mInited = TRUE; | 915 | mInited = TRUE; |
@@ -941,33 +929,41 @@ void flush_glerror() | |||
941 | 929 | ||
942 | void assert_glerror() | 930 | void assert_glerror() |
943 | { | 931 | { |
944 | if (gNoRender) | 932 | if (gNoRender || !gDebugGL) |
945 | { | 933 | { |
946 | return; | 934 | return; |
947 | } | 935 | } |
948 | if (!gGLManager.mInited) | 936 | if (!gGLManager.mInited) |
949 | { | 937 | { |
950 | llerrs << "GL not initialized" << llendl; | 938 | LL_ERRS("RenderInit") << "GL not initialized" << LL_ENDL; |
951 | } | 939 | } |
952 | // Create or update texture to be used with this data | 940 | // Create or update texture to be used with this data |
953 | GLenum error; | 941 | GLenum error; |
954 | error = glGetError(); | 942 | error = glGetError(); |
955 | if (error) | 943 | BOOL quit = FALSE; |
944 | while (error) | ||
956 | { | 945 | { |
946 | quit = TRUE; | ||
957 | #ifndef LL_LINUX // *FIX: ! This should be an error for linux as well. | 947 | #ifndef LL_LINUX // *FIX: ! This should be an error for linux as well. |
958 | GLubyte const * gl_error_msg = gluErrorString(error); | 948 | GLubyte const * gl_error_msg = gluErrorString(error); |
959 | if (NULL != gl_error_msg) | 949 | if (NULL != gl_error_msg) |
960 | { | 950 | { |
961 | llerrs << "GL Error:" << gl_error_msg << llendl; | 951 | LL_WARNS("RenderState") << "GL Error:" << gl_error_msg << LL_ENDL; |
962 | } | 952 | } |
963 | else | 953 | else |
964 | { | 954 | { |
965 | // gluErrorString returns NULL for some extensions' error codes. | 955 | // gluErrorString returns NULL for some extensions' error codes. |
966 | // you'll probably have to grep for the number in glext.h. | 956 | // you'll probably have to grep for the number in glext.h. |
967 | llerrs << "GL Error: UNKNOWN 0x" << std::hex << error << llendl; | 957 | LL_WARNS("RenderState") << "GL Error: UNKNOWN 0x" << std::hex << error << LL_ENDL; |
968 | } | 958 | } |
959 | error = glGetError(); | ||
969 | #endif | 960 | #endif |
970 | } | 961 | } |
962 | |||
963 | if (quit) | ||
964 | { | ||
965 | llerrs << "One or more unhandled GL errors." << llendl; | ||
966 | } | ||
971 | } | 967 | } |
972 | 968 | ||
973 | void clear_glerror() | 969 | void clear_glerror() |
@@ -977,8 +973,7 @@ void clear_glerror() | |||
977 | error = glGetError(); | 973 | error = glGetError(); |
978 | } | 974 | } |
979 | 975 | ||
980 | //============================================================================ | 976 | /////////////////////////////////////////////////////////////// |
981 | |||
982 | // | 977 | // |
983 | // LLGLState | 978 | // LLGLState |
984 | // | 979 | // |
@@ -1014,7 +1009,7 @@ void LLGLState::resetTextureStates() | |||
1014 | glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTextureUnits); | 1009 | glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTextureUnits); |
1015 | for (S32 j = maxTextureUnits-1; j >=0; j--) | 1010 | for (S32 j = maxTextureUnits-1; j >=0; j--) |
1016 | { | 1011 | { |
1017 | glActiveTextureARB(GL_TEXTURE0_ARB+j); | 1012 | gGL.getTexUnit(j)->activate(); |
1018 | glClientActiveTextureARB(GL_TEXTURE0_ARB+j); | 1013 | glClientActiveTextureARB(GL_TEXTURE0_ARB+j); |
1019 | j == 0 ? glEnable(GL_TEXTURE_2D) : glDisable(GL_TEXTURE_2D); | 1014 | j == 0 ? glEnable(GL_TEXTURE_2D) : glDisable(GL_TEXTURE_2D); |
1020 | } | 1015 | } |
@@ -1022,17 +1017,21 @@ void LLGLState::resetTextureStates() | |||
1022 | 1017 | ||
1023 | void LLGLState::dumpStates() | 1018 | void LLGLState::dumpStates() |
1024 | { | 1019 | { |
1025 | llinfos << "GL States:" << llendl; | 1020 | LL_INFOS("RenderState") << "GL States:" << LL_ENDL; |
1026 | for (std::map<LLGLenum, LLGLboolean>::iterator iter = sStateMap.begin(); | 1021 | for (std::map<LLGLenum, LLGLboolean>::iterator iter = sStateMap.begin(); |
1027 | iter != sStateMap.end(); ++iter) | 1022 | iter != sStateMap.end(); ++iter) |
1028 | { | 1023 | { |
1029 | llinfos << llformat(" 0x%04x : %s",(S32)iter->first,iter->second?"TRUE":"FALSE") << llendl; | 1024 | LL_INFOS("RenderState") << llformat(" 0x%04x : %s",(S32)iter->first,iter->second?"TRUE":"FALSE") << LL_ENDL; |
1030 | } | 1025 | } |
1031 | } | 1026 | } |
1032 | 1027 | ||
1033 | void LLGLState::checkStates() | 1028 | void LLGLState::checkStates() |
1034 | { | 1029 | { |
1035 | #if LL_DEBUG_GL | 1030 | if (!gDebugGL) |
1031 | { | ||
1032 | return; | ||
1033 | } | ||
1034 | |||
1036 | stop_glerror(); | 1035 | stop_glerror(); |
1037 | 1036 | ||
1038 | GLint activeTexture; | 1037 | GLint activeTexture; |
@@ -1040,7 +1039,7 @@ void LLGLState::checkStates() | |||
1040 | 1039 | ||
1041 | if (activeTexture != GL_TEXTURE0_ARB) | 1040 | if (activeTexture != GL_TEXTURE0_ARB) |
1042 | { | 1041 | { |
1043 | LL_GL_ERRS << "Texture channel corrupted. " << llendl; | 1042 | LL_GL_ERRS << "Texture channel corrupted. " << LL_ENDL; |
1044 | } | 1043 | } |
1045 | 1044 | ||
1046 | GLint src; | 1045 | GLint src; |
@@ -1050,7 +1049,7 @@ void LLGLState::checkStates() | |||
1050 | 1049 | ||
1051 | if (src != GL_SRC_ALPHA || dst != GL_ONE_MINUS_SRC_ALPHA) | 1050 | if (src != GL_SRC_ALPHA || dst != GL_ONE_MINUS_SRC_ALPHA) |
1052 | { | 1051 | { |
1053 | LL_GL_ERRS << "Blend function corrupted: " << std::hex << src << " " << std::hex << dst << llendl; | 1052 | LL_GL_ERRS << "Blend function corrupted: " << std::hex << src << " " << std::hex << dst << LL_ENDL; |
1054 | } | 1053 | } |
1055 | 1054 | ||
1056 | for (std::map<LLGLenum, LLGLboolean>::iterator iter = sStateMap.begin(); | 1055 | for (std::map<LLGLenum, LLGLboolean>::iterator iter = sStateMap.begin(); |
@@ -1062,17 +1061,20 @@ void LLGLState::checkStates() | |||
1062 | if(cur_state != gl_state) | 1061 | if(cur_state != gl_state) |
1063 | { | 1062 | { |
1064 | dumpStates(); | 1063 | dumpStates(); |
1065 | LL_GL_ERRS << llformat("LLGLState error. State: 0x%04x",state) << llendl; | 1064 | LL_GL_ERRS << llformat("LLGLState error. State: 0x%04x",state) << LL_ENDL; |
1066 | } | 1065 | } |
1067 | } | 1066 | } |
1068 | 1067 | ||
1069 | stop_glerror(); | 1068 | stop_glerror(); |
1070 | #endif | ||
1071 | } | 1069 | } |
1072 | 1070 | ||
1073 | void LLGLState::checkTextureChannels() | 1071 | void LLGLState::checkTextureChannels() |
1074 | { | 1072 | { |
1075 | #if LL_DEBUG_GL | 1073 | if (!gDebugGL) |
1074 | { | ||
1075 | return; | ||
1076 | } | ||
1077 | |||
1076 | GLint activeTexture; | 1078 | GLint activeTexture; |
1077 | glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &activeTexture); | 1079 | glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &activeTexture); |
1078 | 1080 | ||
@@ -1081,12 +1083,12 @@ void LLGLState::checkTextureChannels() | |||
1081 | if (activeTexture != GL_TEXTURE0_ARB) | 1083 | if (activeTexture != GL_TEXTURE0_ARB) |
1082 | { | 1084 | { |
1083 | error = TRUE; | 1085 | error = TRUE; |
1084 | llwarns << "Active texture channel corrupted. " << llendl; | 1086 | LL_WARNS("RenderState") << "Active texture channel corrupted. " << LL_ENDL; |
1085 | } | 1087 | } |
1086 | else if (!glIsEnabled(GL_TEXTURE_2D)) | 1088 | else if (!glIsEnabled(GL_TEXTURE_2D)) |
1087 | { | 1089 | { |
1088 | error = TRUE; | 1090 | error = TRUE; |
1089 | llwarns << "GL_TEXTURE_2D not enabled on texture channel 0." << llendl; | 1091 | LL_WARNS("RenderState") << "GL_TEXTURE_2D not enabled on texture channel 0." << LL_ENDL; |
1090 | } | 1092 | } |
1091 | else | 1093 | else |
1092 | { | 1094 | { |
@@ -1096,7 +1098,7 @@ void LLGLState::checkTextureChannels() | |||
1096 | if (tex_env_mode != GL_MODULATE) | 1098 | if (tex_env_mode != GL_MODULATE) |
1097 | { | 1099 | { |
1098 | error = TRUE; | 1100 | error = TRUE; |
1099 | llwarns << "GL_TEXTURE_ENV_MODE invalid: " << std::hex << tex_env_mode << llendl; | 1101 | LL_WARNS("RenderState") << "GL_TEXTURE_ENV_MODE invalid: " << std::hex << tex_env_mode << LL_ENDL; |
1100 | } | 1102 | } |
1101 | } | 1103 | } |
1102 | 1104 | ||
@@ -1133,7 +1135,7 @@ void LLGLState::checkTextureChannels() | |||
1133 | 1135 | ||
1134 | for (GLint i = 0; i < maxTextureUnits; i++) | 1136 | for (GLint i = 0; i < maxTextureUnits; i++) |
1135 | { | 1137 | { |
1136 | glActiveTextureARB(GL_TEXTURE0_ARB+i); | 1138 | gGL.getTexUnit(i)->activate(); |
1137 | glClientActiveTextureARB(GL_TEXTURE0_ARB+i); | 1139 | glClientActiveTextureARB(GL_TEXTURE0_ARB+i); |
1138 | 1140 | ||
1139 | glGetIntegerv(GL_TEXTURE_STACK_DEPTH, &stackDepth); | 1141 | glGetIntegerv(GL_TEXTURE_STACK_DEPTH, &stackDepth); |
@@ -1141,7 +1143,7 @@ void LLGLState::checkTextureChannels() | |||
1141 | if (stackDepth != 1) | 1143 | if (stackDepth != 1) |
1142 | { | 1144 | { |
1143 | error = TRUE; | 1145 | error = TRUE; |
1144 | llwarns << "Texture matrix stack corrupted." << llendl; | 1146 | LL_WARNS("RenderState") << "Texture matrix stack corrupted." << LL_ENDL; |
1145 | } | 1147 | } |
1146 | 1148 | ||
1147 | glGetFloatv(GL_TEXTURE_MATRIX, (GLfloat*) matrix.mMatrix); | 1149 | glGetFloatv(GL_TEXTURE_MATRIX, (GLfloat*) matrix.mMatrix); |
@@ -1149,7 +1151,7 @@ void LLGLState::checkTextureChannels() | |||
1149 | if (matrix != identity) | 1151 | if (matrix != identity) |
1150 | { | 1152 | { |
1151 | error = TRUE; | 1153 | error = TRUE; |
1152 | llwarns << "Texture matrix in channel " << i << " corrupt." << llendl; | 1154 | LL_WARNS("RenderState") << "Texture matrix in channel " << i << " corrupt." << LL_ENDL; |
1153 | } | 1155 | } |
1154 | 1156 | ||
1155 | for (S32 j = (i == 0 ? 1 : 0); j < 8; j++) | 1157 | for (S32 j = (i == 0 ? 1 : 0); j < 8; j++) |
@@ -1157,24 +1159,27 @@ void LLGLState::checkTextureChannels() | |||
1157 | if (glIsEnabled(value[j])) | 1159 | if (glIsEnabled(value[j])) |
1158 | { | 1160 | { |
1159 | error = TRUE; | 1161 | error = TRUE; |
1160 | llwarns << "Texture channel " << i << " still has " << label[j] << " enabled." << llendl; | 1162 | LL_WARNS("RenderState") << "Texture channel " << i << " still has " << label[j] << " enabled." << LL_ENDL; |
1161 | } | 1163 | } |
1162 | } | 1164 | } |
1163 | } | 1165 | } |
1164 | 1166 | ||
1165 | glActiveTextureARB(GL_TEXTURE0_ARB); | 1167 | gGL.getTexUnit(0)->activate(); |
1166 | glClientActiveTextureARB(GL_TEXTURE0_ARB); | 1168 | glClientActiveTextureARB(GL_TEXTURE0_ARB); |
1167 | 1169 | ||
1168 | if (error) | 1170 | if (error) |
1169 | { | 1171 | { |
1170 | LL_GL_ERRS << "GL texture state corruption detected." << llendl; | 1172 | LL_GL_ERRS << "GL texture state corruption detected." << LL_ENDL; |
1171 | } | 1173 | } |
1172 | #endif | ||
1173 | } | 1174 | } |
1174 | 1175 | ||
1175 | void LLGLState::checkClientArrays(U32 data_mask) | 1176 | void LLGLState::checkClientArrays(U32 data_mask) |
1176 | { | 1177 | { |
1177 | #if LL_DEBUG_GL | 1178 | if (!gDebugGL) |
1179 | { | ||
1180 | return; | ||
1181 | } | ||
1182 | |||
1178 | stop_glerror(); | 1183 | stop_glerror(); |
1179 | BOOL error = FALSE; | 1184 | BOOL error = FALSE; |
1180 | 1185 | ||
@@ -1226,7 +1231,7 @@ void LLGLState::checkClientArrays(U32 data_mask) | |||
1226 | if (!(mask[j] & data_mask)) | 1231 | if (!(mask[j] & data_mask)) |
1227 | { | 1232 | { |
1228 | error = TRUE; | 1233 | error = TRUE; |
1229 | llwarns << "GL still has " << label[j] << " enabled." << llendl; | 1234 | LL_WARNS("RenderState") << "GL still has " << label[j] << " enabled." << LL_ENDL; |
1230 | } | 1235 | } |
1231 | } | 1236 | } |
1232 | else | 1237 | else |
@@ -1234,19 +1239,19 @@ void LLGLState::checkClientArrays(U32 data_mask) | |||
1234 | if (mask[j] & data_mask) | 1239 | if (mask[j] & data_mask) |
1235 | { | 1240 | { |
1236 | error = TRUE; | 1241 | error = TRUE; |
1237 | llwarns << "GL does not have " << label[j] << " enabled." << llendl; | 1242 | LL_WARNS("RenderState") << "GL does not have " << label[j] << " enabled." << LL_ENDL; |
1238 | } | 1243 | } |
1239 | } | 1244 | } |
1240 | } | 1245 | } |
1241 | 1246 | ||
1242 | glClientActiveTextureARB(GL_TEXTURE1_ARB); | 1247 | glClientActiveTextureARB(GL_TEXTURE1_ARB); |
1243 | glActiveTextureARB(GL_TEXTURE1_ARB); | 1248 | gGL.getTexUnit(1)->activate(); |
1244 | if (glIsEnabled(GL_TEXTURE_COORD_ARRAY)) | 1249 | if (glIsEnabled(GL_TEXTURE_COORD_ARRAY)) |
1245 | { | 1250 | { |
1246 | if (!(data_mask & 0x0008)) | 1251 | if (!(data_mask & 0x0008)) |
1247 | { | 1252 | { |
1248 | error = TRUE; | 1253 | error = TRUE; |
1249 | llwarns << "GL still has GL_TEXTURE_COORD_ARRAY enabled on channel 1." << llendl; | 1254 | LL_WARNS("RenderState") << "GL still has GL_TEXTURE_COORD_ARRAY enabled on channel 1." << LL_ENDL; |
1250 | } | 1255 | } |
1251 | } | 1256 | } |
1252 | else | 1257 | else |
@@ -1254,7 +1259,7 @@ void LLGLState::checkClientArrays(U32 data_mask) | |||
1254 | if (data_mask & 0x0008) | 1259 | if (data_mask & 0x0008) |
1255 | { | 1260 | { |
1256 | error = TRUE; | 1261 | error = TRUE; |
1257 | llwarns << "GL does not have GL_TEXTURE_COORD_ARRAY enabled on channel 1." << llendl; | 1262 | LL_WARNS("RenderState") << "GL does not have GL_TEXTURE_COORD_ARRAY enabled on channel 1." << LL_ENDL; |
1258 | } | 1263 | } |
1259 | } | 1264 | } |
1260 | 1265 | ||
@@ -1263,7 +1268,7 @@ void LLGLState::checkClientArrays(U32 data_mask) | |||
1263 | if (!(data_mask & 0x0008)) | 1268 | if (!(data_mask & 0x0008)) |
1264 | { | 1269 | { |
1265 | error = TRUE; | 1270 | error = TRUE; |
1266 | llwarns << "GL still has GL_TEXTURE_2D enabled on channel 1." << llendl; | 1271 | LL_WARNS("RenderState") << "GL still has GL_TEXTURE_2D enabled on channel 1." << LL_ENDL; |
1267 | } | 1272 | } |
1268 | } | 1273 | } |
1269 | else | 1274 | else |
@@ -1271,26 +1276,25 @@ void LLGLState::checkClientArrays(U32 data_mask) | |||
1271 | if (data_mask & 0x0008) | 1276 | if (data_mask & 0x0008) |
1272 | { | 1277 | { |
1273 | error = TRUE; | 1278 | error = TRUE; |
1274 | llwarns << "GL does not have GL_TEXTURE_2D enabled on channel 1." << llendl; | 1279 | LL_WARNS("RenderState") << "GL does not have GL_TEXTURE_2D enabled on channel 1." << LL_ENDL; |
1275 | } | 1280 | } |
1276 | } | 1281 | } |
1277 | 1282 | ||
1278 | glClientActiveTextureARB(GL_TEXTURE0_ARB); | 1283 | glClientActiveTextureARB(GL_TEXTURE0_ARB); |
1279 | glActiveTextureARB(GL_TEXTURE0_ARB); | 1284 | gGL.getTexUnit(0)->activate(); |
1280 | 1285 | ||
1281 | if (error) | 1286 | if (error) |
1282 | { | 1287 | { |
1283 | LL_GL_ERRS << "GL client array corruption detected." << llendl; | 1288 | LL_GL_ERRS << "GL client array corruption detected." << LL_ENDL; |
1284 | } | 1289 | } |
1285 | #endif | ||
1286 | } | 1290 | } |
1287 | 1291 | ||
1288 | //============================================================================ | 1292 | /////////////////////////////////////////////////////////////////////// |
1289 | 1293 | ||
1290 | LLGLState::LLGLState(LLGLenum state, S32 enabled) | 1294 | LLGLState::LLGLState(LLGLenum state, S32 enabled) : |
1295 | mState(state), mWasEnabled(FALSE), mIsEnabled(FALSE) | ||
1291 | { | 1296 | { |
1292 | stop_glerror(); | 1297 | stop_glerror(); |
1293 | mState = state; | ||
1294 | if (state) | 1298 | if (state) |
1295 | { | 1299 | { |
1296 | mWasEnabled = sStateMap[state]; | 1300 | mWasEnabled = sStateMap[state]; |
@@ -1330,9 +1334,11 @@ LLGLState::~LLGLState() | |||
1330 | stop_glerror(); | 1334 | stop_glerror(); |
1331 | if (mState) | 1335 | if (mState) |
1332 | { | 1336 | { |
1333 | #if LL_DEBUG_GL | 1337 | if (gDebugGL) |
1334 | llassert(sStateMap[mState] == glIsEnabled(mState)); | 1338 | { |
1335 | #endif | 1339 | llassert_always(sStateMap[mState] == glIsEnabled(mState)); |
1340 | } | ||
1341 | |||
1336 | if (mIsEnabled != mWasEnabled) | 1342 | if (mIsEnabled != mWasEnabled) |
1337 | { | 1343 | { |
1338 | gGL.flush(); | 1344 | gGL.flush(); |
@@ -1351,7 +1357,7 @@ LLGLState::~LLGLState() | |||
1351 | stop_glerror(); | 1357 | stop_glerror(); |
1352 | } | 1358 | } |
1353 | 1359 | ||
1354 | //============================================================================ | 1360 | //////////////////////////////////////////////////////////////////////////////// |
1355 | 1361 | ||
1356 | void LLGLManager::initGLStates() | 1362 | void LLGLManager::initGLStates() |
1357 | { | 1363 | { |
@@ -1359,7 +1365,7 @@ void LLGLManager::initGLStates() | |||
1359 | LLGLState::initClass(); | 1365 | LLGLState::initClass(); |
1360 | } | 1366 | } |
1361 | 1367 | ||
1362 | //============================================================================ | 1368 | //////////////////////////////////////////////////////////////////////////////// |
1363 | 1369 | ||
1364 | void enable_vertex_weighting(const S32 index) | 1370 | void enable_vertex_weighting(const S32 index) |
1365 | { | 1371 | { |
diff --git a/linden/indra/llwindow/llgl.h b/linden/indra/llwindow/llgl.h index e8f17bf..2618dca 100644 --- a/linden/indra/llwindow/llgl.h +++ b/linden/indra/llwindow/llgl.h | |||
@@ -48,9 +48,9 @@ | |||
48 | #include "llglheaders.h" | 48 | #include "llglheaders.h" |
49 | #include "glh/glh_linear.h" | 49 | #include "glh/glh_linear.h" |
50 | 50 | ||
51 | #define LL_DEBUG_GL 1 | 51 | extern BOOL gDebugGL; |
52 | 52 | ||
53 | #define LL_GL_ERRS llerrs | 53 | #define LL_GL_ERRS LL_ERRS("RenderState") |
54 | 54 | ||
55 | class LLSD; | 55 | class LLSD; |
56 | 56 | ||
@@ -92,7 +92,7 @@ public: | |||
92 | BOOL mHasARBEnvCombine; | 92 | BOOL mHasARBEnvCombine; |
93 | BOOL mHasCubeMap; | 93 | BOOL mHasCubeMap; |
94 | 94 | ||
95 | // Vender specific extensions | 95 | // Vendor-specific extensions |
96 | BOOL mIsATI; | 96 | BOOL mIsATI; |
97 | BOOL mIsNVIDIA; | 97 | BOOL mIsNVIDIA; |
98 | BOOL mIsIntel; | 98 | BOOL mIsIntel; |
@@ -104,18 +104,7 @@ public: | |||
104 | // Whether this version of GL is good enough for SL to use | 104 | // Whether this version of GL is good enough for SL to use |
105 | BOOL mHasRequirements; | 105 | BOOL mHasRequirements; |
106 | 106 | ||
107 | #if LL_WINDOWS | 107 | // Misc extensions |
108 | BOOL mHasWGLARBPixelFormat; | ||
109 | #endif // LL_WINDOWS | ||
110 | |||
111 | #if LL_DARWIN | ||
112 | // Apple extensions. | ||
113 | BOOL mHasAPPLEVertexArrayRange; | ||
114 | BOOL mHasAPPLEFence; | ||
115 | BOOL mHasAPPLEVAO; | ||
116 | #endif | ||
117 | |||
118 | // Misc exitensions | ||
119 | BOOL mHasSeparateSpecularColor; | 108 | BOOL mHasSeparateSpecularColor; |
120 | 109 | ||
121 | S32 mDriverVersionMajor; | 110 | S32 mDriverVersionMajor; |
@@ -131,6 +120,7 @@ public: | |||
131 | void getPixelFormat(); // Get the best pixel format | 120 | void getPixelFormat(); // Get the best pixel format |
132 | 121 | ||
133 | LLString getGLInfoString(); | 122 | LLString getGLInfoString(); |
123 | void printGLInfoString(); | ||
134 | void getGLInfo(LLSD& info); | 124 | void getGLInfo(LLSD& info); |
135 | 125 | ||
136 | // In ALL CAPS | 126 | // In ALL CAPS |
@@ -159,13 +149,13 @@ void assert_glerror(); | |||
159 | 149 | ||
160 | void clear_glerror(); | 150 | void clear_glerror(); |
161 | 151 | ||
162 | #if LL_DEBUG | 152 | //#if LL_DEBUG |
163 | # define stop_glerror() assert_glerror() | 153 | # define stop_glerror() assert_glerror() |
164 | # define llglassertok() assert_glerror() | 154 | # define llglassertok() assert_glerror() |
165 | #else | 155 | //#else |
166 | # define stop_glerror() | 156 | //# define stop_glerror() |
167 | # define llglassertok() | 157 | //# define llglassertok() |
168 | #endif | 158 | //#endif |
169 | 159 | ||
170 | #define llglassertok_always() assert_glerror() | 160 | #define llglassertok_always() assert_glerror() |
171 | 161 | ||
diff --git a/linden/indra/llwindow/llwindow.cpp b/linden/indra/llwindow/llwindow.cpp index 9963228..ffb6393 100644 --- a/linden/indra/llwindow/llwindow.cpp +++ b/linden/indra/llwindow/llwindow.cpp | |||
@@ -40,8 +40,6 @@ | |||
40 | #include "llwindowwin32.h" | 40 | #include "llwindowwin32.h" |
41 | #elif LL_DARWIN | 41 | #elif LL_DARWIN |
42 | #include "llwindowmacosx.h" | 42 | #include "llwindowmacosx.h" |
43 | #elif LL_LINUX | ||
44 | #include "llwindowlinux.h" // currently just a dummy wrapper | ||
45 | #endif | 43 | #endif |
46 | 44 | ||
47 | #include "llerror.h" | 45 | #include "llerror.h" |
@@ -287,6 +285,20 @@ void LLWindow::setCallbacks(LLWindowCallbacks *callbacks) | |||
287 | } | 285 | } |
288 | } | 286 | } |
289 | 287 | ||
288 | // static | ||
289 | std::string LLWindow::getFontListSans() | ||
290 | { | ||
291 | #if LL_WINDOWS | ||
292 | return LLWindowWin32::getFontListSans(); | ||
293 | #elif LL_DARWIN | ||
294 | return LLWindowMacOSX::getFontListSans(); | ||
295 | #elif LL_SDL | ||
296 | return LLWindowSDL::getFontListSans(); | ||
297 | #else | ||
298 | return ""; | ||
299 | #endif | ||
300 | } | ||
301 | |||
290 | #define UTF16_IS_HIGH_SURROGATE(U) ((U16)((U) - 0xD800) < 0x0400) | 302 | #define UTF16_IS_HIGH_SURROGATE(U) ((U16)((U) - 0xD800) < 0x0400) |
291 | #define UTF16_IS_LOW_SURROGATE(U) ((U16)((U) - 0xDC00) < 0x0400) | 303 | #define UTF16_IS_LOW_SURROGATE(U) ((U16)((U) - 0xDC00) < 0x0400) |
292 | #define UTF16_SURROGATE_PAIR_TO_UTF32(H,L) (((H) << 10) + (L) - (0xD800 << 10) - 0xDC00 + 0x00010000) | 304 | #define UTF16_SURROGATE_PAIR_TO_UTF32(H,L) (((H) << 10) + (L) - (0xD800 << 10) - 0xDC00 + 0x00010000) |
@@ -450,10 +462,6 @@ LLWindow* LLWindowManager::createWindow( | |||
450 | new_window = new LLWindowMacOSX( | 462 | new_window = new LLWindowMacOSX( |
451 | title, name, x, y, width, height, flags, | 463 | title, name, x, y, width, height, flags, |
452 | fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples); | 464 | fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples); |
453 | #elif LL_LINUX | ||
454 | new_window = new LLWindowLinux( | ||
455 | title, name, x, y, width, height, flags, | ||
456 | fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth); | ||
457 | #endif | 465 | #endif |
458 | } | 466 | } |
459 | else | 467 | else |
diff --git a/linden/indra/llwindow/llwindow.h b/linden/indra/llwindow/llwindow.h index 89de5a0..a63c8d5 100644 --- a/linden/indra/llwindow/llwindow.h +++ b/linden/indra/llwindow/llwindow.h | |||
@@ -234,6 +234,8 @@ public: | |||
234 | virtual void updateLanguageTextInputArea() {} | 234 | virtual void updateLanguageTextInputArea() {} |
235 | virtual void interruptLanguageTextInput() {} | 235 | virtual void interruptLanguageTextInput() {} |
236 | 236 | ||
237 | static std::string getFontListSans(); | ||
238 | |||
237 | protected: | 239 | protected: |
238 | LLWindow(BOOL fullscreen, U32 flags); | 240 | LLWindow(BOOL fullscreen, U32 flags); |
239 | virtual ~LLWindow() {} | 241 | virtual ~LLWindow() {} |
diff --git a/linden/indra/llwindow/llwindowlinux.cpp b/linden/indra/llwindow/llwindowlinux.cpp deleted file mode 100644 index 6c026e4..0000000 --- a/linden/indra/llwindow/llwindowlinux.cpp +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /** | ||
2 | * @file llwindowlinux.cpp | ||
3 | * @brief Platform-dependent implementation of llwindow | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
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 | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #if LL_LINUX | ||
33 | |||
34 | #include "linden_common.h" | ||
35 | #include "indra_constants.h" | ||
36 | |||
37 | #include "llwindowlinux.h" | ||
38 | #include "llgl.h" | ||
39 | #include "llglheaders.h" | ||
40 | |||
41 | // | ||
42 | // LLWindowLinux | ||
43 | // | ||
44 | LLWindowLinux::LLWindowLinux(char *title, char *name, S32 x, S32 y, S32 width, S32 height, | ||
45 | U32 flags, BOOL fullscreen, BOOL clearBg, | ||
46 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth) | ||
47 | : LLWindow(fullscreen, flags) | ||
48 | { | ||
49 | llerrs << "Linux window not yet supported" << llendl; | ||
50 | } | ||
51 | |||
52 | |||
53 | LLWindowLinux::~LLWindowLinux() | ||
54 | { | ||
55 | } | ||
56 | |||
57 | void LLWindowLinux::swapBuffers() | ||
58 | { | ||
59 | } | ||
60 | |||
61 | #endif // LL_LINUX | ||
diff --git a/linden/indra/llwindow/llwindowlinux.h b/linden/indra/llwindow/llwindowlinux.h deleted file mode 100644 index da80fd4..0000000 --- a/linden/indra/llwindow/llwindowlinux.h +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | /** | ||
2 | * @file llwindowlinux.h | ||
3 | * @brief Linux implementation of LLWindow class | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
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 | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #ifndef LL_LLWINDOWWIN32_H | ||
33 | #define LL_LLWINDOWWIN32_H | ||
34 | |||
35 | #include "llwindow.h" | ||
36 | |||
37 | class LLWindowLinux : public LLWindow | ||
38 | { | ||
39 | public: | ||
40 | /*virtual*/ void show() {}; | ||
41 | /*virtual*/ void hide() {}; | ||
42 | /*virtual*/ void close() {}; | ||
43 | /*virtual*/ BOOL getVisible() {return FALSE;}; | ||
44 | /*virtual*/ BOOL getMinimized() {return FALSE;}; | ||
45 | /*virtual*/ BOOL getMaximized() {return FALSE;}; | ||
46 | /*virtual*/ BOOL maximize() {return FALSE;}; | ||
47 | /*virtual*/ BOOL getFullscreen() {return FALSE;}; | ||
48 | /*virtual*/ BOOL getPosition(LLCoordScreen *position) {return FALSE;}; | ||
49 | /*virtual*/ BOOL getSize(LLCoordScreen *size) {return FALSE;}; | ||
50 | /*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;}; | ||
51 | /*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;}; | ||
52 | /*virtual*/ BOOL setSize(LLCoordScreen size) {return FALSE;}; | ||
53 | /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;}; | ||
54 | /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;}; | ||
55 | /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;}; | ||
56 | /*virtual*/ void showCursor() {}; | ||
57 | /*virtual*/ void hideCursor() {}; | ||
58 | /*virtual*/ void showCursorFromMouseMove() {}; | ||
59 | /*virtual*/ void hideCursorUntilMouseMove() {}; | ||
60 | /*virtual*/ BOOL isCursorHidden() {return FALSE;}; | ||
61 | /*virtual*/ void setCursor(ECursorType cursor) {}; | ||
62 | //virtual ECursorType getCursor() { return mCurrentCursor; }; | ||
63 | /*virtual*/ void captureMouse() {}; | ||
64 | /*virtual*/ void releaseMouse() {}; | ||
65 | /*virtual*/ void setMouseClipping( BOOL b ) {}; | ||
66 | /*virtual*/ BOOL isClipboardTextAvailable() {return FALSE; }; | ||
67 | /*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst) {return FALSE; }; | ||
68 | /*virtual*/ BOOL copyTextToClipboard(const LLWString &src) {return FALSE; }; | ||
69 | /*virtual*/ void flashIcon(F32 seconds) {}; | ||
70 | /*virtual*/ F32 getGamma() {return 1.0f; }; | ||
71 | /*virtual*/ BOOL setGamma(const F32 gamma) {return FALSE; }; // Set the gamma | ||
72 | /*virtual*/ BOOL restoreGamma() {return FALSE; }; // Restore original gamma table (before updating gamma) | ||
73 | //virtual ESwapMethod getSwapMethod() { return mSwapMethod; } | ||
74 | /*virtual*/ void gatherInput() {}; | ||
75 | /*virtual*/ void delayInputProcessing() {}; | ||
76 | /*virtual*/ void swapBuffers(); | ||
77 | |||
78 | /*virtual*/ LLString getTempFileName() {return LLString(""); }; | ||
79 | /*virtual*/ void deleteFile( const char* file_name ) {}; | ||
80 | /*virtual*/ S32 stat( const char* file_name, struct stat* stat_info ) {return 0; }; | ||
81 | /*virtual*/ BOOL sendEmail(const char* address,const char* subject,const char* body_text,const char* attachment=NULL, const char* attachment_displayed_name=NULL) { return FALSE; }; | ||
82 | |||
83 | |||
84 | // handy coordinate space conversion routines | ||
85 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; }; | ||
86 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; }; | ||
87 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) { return FALSE; }; | ||
88 | /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordWindow *to) { return FALSE; }; | ||
89 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordGL *to) { return FALSE; }; | ||
90 | /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordScreen *to) { return FALSE; }; | ||
91 | |||
92 | /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) { return NULL; }; | ||
93 | /*virtual*/ F32 getNativeAspectRatio() { return 1.0f; }; | ||
94 | /*virtual*/ F32 getPixelAspectRatio() { return 1.0f; }; | ||
95 | /*virtual*/ void setNativeAspectRatio(F32 ratio) {} | ||
96 | |||
97 | //virtual BOOL dialog_color_picker (F32 *r, F32 *g, F32 *b ); | ||
98 | |||
99 | /*virtual*/ void *getPlatformWindow() { return NULL; } | ||
100 | |||
101 | LLWindowLinux(char *title, char *name, S32 x, S32 y, S32 width, S32 height, | ||
102 | U32 flags, BOOL fullscreen, BOOL clearBg, | ||
103 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); | ||
104 | ~LLWindowLinux(); | ||
105 | }; | ||
106 | |||
107 | class LLSplashScreenLinux : public LLSplashScreen | ||
108 | { | ||
109 | public: | ||
110 | LLSplashScreenLinux() {}; | ||
111 | virtual ~LLSplashScreenLinux() {}; | ||
112 | |||
113 | /*virtual*/ void showImpl() {}; | ||
114 | /*virtual*/ void updateImpl(const char* mesg) {}; | ||
115 | /*virtual*/ void hideImpl() {}; | ||
116 | |||
117 | }; | ||
118 | |||
119 | #endif //LL_LLWINDOWWIN32_H | ||
diff --git a/linden/indra/llwindow/llwindowmacosx-objc.mm b/linden/indra/llwindow/llwindowmacosx-objc.mm index d2efd77..d4ea2be 100644 --- a/linden/indra/llwindow/llwindowmacosx-objc.mm +++ b/linden/indra/llwindow/llwindowmacosx-objc.mm | |||
@@ -47,6 +47,8 @@ void setupCocoa() | |||
47 | 47 | ||
48 | if(!inited) | 48 | if(!inited) |
49 | { | 49 | { |
50 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | ||
51 | |||
50 | // This is a bit of voodoo taken from the Apple sample code "CarbonCocoa_PictureCursor": | 52 | // This is a bit of voodoo taken from the Apple sample code "CarbonCocoa_PictureCursor": |
51 | // http://developer.apple.com/samplecode/CarbonCocoa_PictureCursor/index.html | 53 | // http://developer.apple.com/samplecode/CarbonCocoa_PictureCursor/index.html |
52 | 54 | ||
@@ -55,6 +57,8 @@ void setupCocoa() | |||
55 | 57 | ||
56 | // Must first call [[[NSWindow alloc] init] release] to get the NSWindow machinery set up so that NSCursor can use a window to cache the cursor image | 58 | // Must first call [[[NSWindow alloc] init] release] to get the NSWindow machinery set up so that NSCursor can use a window to cache the cursor image |
57 | [[[NSWindow alloc] init] release]; | 59 | [[[NSWindow alloc] init] release]; |
60 | |||
61 | [pool release]; | ||
58 | } | 62 | } |
59 | } | 63 | } |
60 | 64 | ||
@@ -82,8 +86,10 @@ OSErr releaseImageCursor(CursorRef ref) | |||
82 | { | 86 | { |
83 | if( ref != NULL ) | 87 | if( ref != NULL ) |
84 | { | 88 | { |
89 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | ||
85 | NSCursor *cursor = (NSCursor*)ref; | 90 | NSCursor *cursor = (NSCursor*)ref; |
86 | [cursor release]; | 91 | [cursor release]; |
92 | [pool release]; | ||
87 | } | 93 | } |
88 | else | 94 | else |
89 | { | 95 | { |
@@ -97,8 +103,10 @@ OSErr setImageCursor(CursorRef ref) | |||
97 | { | 103 | { |
98 | if( ref != NULL ) | 104 | if( ref != NULL ) |
99 | { | 105 | { |
106 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | ||
100 | NSCursor *cursor = (NSCursor*)ref; | 107 | NSCursor *cursor = (NSCursor*)ref; |
101 | [cursor set]; | 108 | [cursor set]; |
109 | [pool release]; | ||
102 | } | 110 | } |
103 | else | 111 | else |
104 | { | 112 | { |
diff --git a/linden/indra/llwindow/llwindowmacosx.cpp b/linden/indra/llwindow/llwindowmacosx.cpp index f5cc8c6..5ab0ba6 100644 --- a/linden/indra/llwindow/llwindowmacosx.cpp +++ b/linden/indra/llwindow/llwindowmacosx.cpp | |||
@@ -359,7 +359,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
359 | 359 | ||
360 | if (mFullscreen && (mOldDisplayMode == NULL)) | 360 | if (mFullscreen && (mOldDisplayMode == NULL)) |
361 | { | 361 | { |
362 | llinfos << "createContext: setting up fullscreen " << width << "x" << height << llendl; | 362 | LL_INFOS("Window") << "createContext: setting up fullscreen " << width << "x" << height << LL_ENDL; |
363 | 363 | ||
364 | // NOTE: The refresh rate will be REPORTED AS 0 for many DVI and notebook displays. Plan accordingly. | 364 | // NOTE: The refresh rate will be REPORTED AS 0 for many DVI and notebook displays. Plan accordingly. |
365 | double refresh = getDictDouble (CGDisplayCurrentMode (mDisplay), kCGDisplayRefreshRate); | 365 | double refresh = getDictDouble (CGDisplayCurrentMode (mDisplay), kCGDisplayRefreshRate); |
@@ -380,18 +380,18 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
380 | U32 closestWidth = 0; | 380 | U32 closestWidth = 0; |
381 | int i; | 381 | int i; |
382 | 382 | ||
383 | llinfos << "createContext: searching for a display mode, original aspect is " << mOriginalAspectRatio << llendl; | 383 | LL_DEBUGS("Window") << "createContext: searching for a display mode, original aspect is " << mOriginalAspectRatio << LL_ENDL; |
384 | 384 | ||
385 | for(i=0; i < resolutionCount; i++) | 385 | for(i=0; i < resolutionCount; i++) |
386 | { | 386 | { |
387 | F32 aspect = (F32)resolutionList[i].mWidth / (F32)resolutionList[i].mHeight; | 387 | F32 aspect = (F32)resolutionList[i].mWidth / (F32)resolutionList[i].mHeight; |
388 | 388 | ||
389 | llinfos << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << llendl; | 389 | LL_DEBUGS("Window") << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << LL_ENDL; |
390 | 390 | ||
391 | if( (resolutionList[i].mHeight >= 700) && (resolutionList[i].mHeight <= 800) && | 391 | if( (resolutionList[i].mHeight >= 700) && (resolutionList[i].mHeight <= 800) && |
392 | (fabs(aspect - mOriginalAspectRatio) < fabs(closestAspect - mOriginalAspectRatio))) | 392 | (fabs(aspect - mOriginalAspectRatio) < fabs(closestAspect - mOriginalAspectRatio))) |
393 | { | 393 | { |
394 | llinfos << " (new closest mode) " << llendl; | 394 | LL_DEBUGS("Window") << " (new closest mode) " << LL_ENDL; |
395 | 395 | ||
396 | // This is the closest mode we've seen yet. | 396 | // This is the closest mode we've seen yet. |
397 | closestWidth = resolutionList[i].mWidth; | 397 | closestWidth = resolutionList[i].mWidth; |
@@ -437,7 +437,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
437 | 437 | ||
438 | if (refDisplayMode) | 438 | if (refDisplayMode) |
439 | { | 439 | { |
440 | llinfos << "createContext: switching display resolution" << llendl; | 440 | LL_DEBUGS("Window") << "createContext: switching display resolution" << LL_ENDL; |
441 | mOldDisplayMode = CGDisplayCurrentMode (mDisplay); | 441 | mOldDisplayMode = CGDisplayCurrentMode (mDisplay); |
442 | CGDisplaySwitchToMode (mDisplay, refDisplayMode); | 442 | CGDisplaySwitchToMode (mDisplay, refDisplayMode); |
443 | // CFRelease(refDisplayMode); | 443 | // CFRelease(refDisplayMode); |
@@ -452,11 +452,11 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
452 | mFullscreenBits = CGDisplayBitsPerPixel(mDisplay); | 452 | mFullscreenBits = CGDisplayBitsPerPixel(mDisplay); |
453 | mFullscreenRefresh = llround(getDictDouble (CGDisplayCurrentMode (mDisplay), kCGDisplayRefreshRate)); | 453 | mFullscreenRefresh = llround(getDictDouble (CGDisplayCurrentMode (mDisplay), kCGDisplayRefreshRate)); |
454 | 454 | ||
455 | llinfos << "Running at " << mFullscreenWidth | 455 | LL_INFOS("Window") << "Running at " << mFullscreenWidth |
456 | << "x" << mFullscreenHeight | 456 | << "x" << mFullscreenHeight |
457 | << "x" << mFullscreenBits | 457 | << "x" << mFullscreenBits |
458 | << " @ " << mFullscreenRefresh | 458 | << " @ " << mFullscreenRefresh |
459 | << llendl; | 459 | << LL_ENDL; |
460 | } | 460 | } |
461 | else | 461 | else |
462 | { | 462 | { |
@@ -480,7 +480,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
480 | //int displayHeight = CGDisplayPixelsHigh(mDisplay); | 480 | //int displayHeight = CGDisplayPixelsHigh(mDisplay); |
481 | //const int menuBarPlusTitleBar = 44; // Ugly magic number. | 481 | //const int menuBarPlusTitleBar = 44; // Ugly magic number. |
482 | 482 | ||
483 | llinfos << "createContext: creating window" << llendl; | 483 | LL_DEBUGS("Window") << "createContext: creating window" << LL_ENDL; |
484 | 484 | ||
485 | window_rect.left = (long) x; | 485 | window_rect.left = (long) x; |
486 | window_rect.right = (long) x + width; | 486 | window_rect.right = (long) x + width; |
@@ -534,7 +534,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
534 | err = NewTSMDocument(1, types, &mTSMDocument, 0); | 534 | err = NewTSMDocument(1, types, &mTSMDocument, 0); |
535 | if (err != noErr) | 535 | if (err != noErr) |
536 | { | 536 | { |
537 | llwarns << "createContext: couldn't create a TSMDocument (" << err << ")" << llendl; | 537 | LL_WARNS("Window") << "createContext: couldn't create a TSMDocument (" << err << ")" << LL_ENDL; |
538 | } | 538 | } |
539 | if (mTSMDocument) | 539 | if (mTSMDocument) |
540 | { | 540 | { |
@@ -575,7 +575,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
575 | AGL_NONE | 575 | AGL_NONE |
576 | }; | 576 | }; |
577 | 577 | ||
578 | llinfos << "createContext: creating fullscreen pixelformat" << llendl; | 578 | LL_DEBUGS("Window") << "createContext: creating fullscreen pixelformat" << LL_ENDL; |
579 | 579 | ||
580 | GDHandle gdhDisplay = NULL; | 580 | GDHandle gdhDisplay = NULL; |
581 | err = DMGetGDeviceByDisplayID ((DisplayIDType)mDisplay, &gdhDisplay, false); | 581 | err = DMGetGDeviceByDisplayID ((DisplayIDType)mDisplay, &gdhDisplay, false); |
@@ -602,7 +602,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
602 | AGL_NONE | 602 | AGL_NONE |
603 | }; | 603 | }; |
604 | 604 | ||
605 | llinfos << "createContext: creating windowed pixelformat" << llendl; | 605 | LL_DEBUGS("Window") << "createContext: creating windowed pixelformat" << LL_ENDL; |
606 | 606 | ||
607 | mPixelFormat = aglChoosePixelFormat(NULL, 0, windowedAttrib); | 607 | mPixelFormat = aglChoosePixelFormat(NULL, 0, windowedAttrib); |
608 | 608 | ||
@@ -622,7 +622,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
622 | 622 | ||
623 | if(mPixelFormat) | 623 | if(mPixelFormat) |
624 | { | 624 | { |
625 | llinfos << "createContext: creating GL context" << llendl; | 625 | LL_DEBUGS("Window") << "createContext: creating GL context" << LL_ENDL; |
626 | mContext = aglCreateContext(mPixelFormat, NULL); | 626 | mContext = aglCreateContext(mPixelFormat, NULL); |
627 | } | 627 | } |
628 | 628 | ||
@@ -670,7 +670,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
670 | { | 670 | { |
671 | // We successfully captured the display. Use a fullscreen drawable | 671 | // We successfully captured the display. Use a fullscreen drawable |
672 | 672 | ||
673 | llinfos << "createContext: attaching fullscreen drawable" << llendl; | 673 | LL_DEBUGS("Window") << "createContext: attaching fullscreen drawable" << LL_ENDL; |
674 | 674 | ||
675 | #if CAPTURE_ALL_DISPLAYS | 675 | #if CAPTURE_ALL_DISPLAYS |
676 | // Capture all displays (may want to do this for final build) | 676 | // Capture all displays (may want to do this for final build) |
@@ -688,7 +688,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
688 | } | 688 | } |
689 | else if(!mFullscreen && (mWindow != NULL)) | 689 | else if(!mFullscreen && (mWindow != NULL)) |
690 | { | 690 | { |
691 | llinfos << "createContext: attaching windowed drawable" << llendl; | 691 | LL_DEBUGS("Window") << "createContext: attaching windowed drawable" << LL_ENDL; |
692 | 692 | ||
693 | // We created a window. Use it as the drawable. | 693 | // We created a window. Use it as the drawable. |
694 | if(!aglSetDrawable(mContext, GetWindowPort (mWindow))) | 694 | if(!aglSetDrawable(mContext, GetWindowPort (mWindow))) |
@@ -705,7 +705,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
705 | 705 | ||
706 | if(mContext != NULL) | 706 | if(mContext != NULL) |
707 | { | 707 | { |
708 | llinfos << "createContext: setting current context" << llendl; | 708 | LL_DEBUGS("Window") << "createContext: setting current context" << LL_ENDL; |
709 | 709 | ||
710 | if (!aglSetCurrentContext(mContext)) | 710 | if (!aglSetCurrentContext(mContext)) |
711 | { | 711 | { |
@@ -759,11 +759,11 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
759 | return FALSE; | 759 | return FALSE; |
760 | } | 760 | } |
761 | 761 | ||
762 | llinfos << "GL buffer: Color Bits " << S32(colorBits) | 762 | LL_INFOS("GLInit") << "GL buffer: Color Bits " << S32(colorBits) |
763 | << " Alpha Bits " << S32(alphaBits) | 763 | << " Alpha Bits " << S32(alphaBits) |
764 | << " Depth Bits " << S32(depthBits) | 764 | << " Depth Bits " << S32(depthBits) |
765 | << " Stencil Bits" << S32(stencilBits) | 765 | << " Stencil Bits" << S32(stencilBits) |
766 | << llendl; | 766 | << LL_ENDL; |
767 | 767 | ||
768 | if (colorBits < 32) | 768 | if (colorBits < 32) |
769 | { | 769 | { |
@@ -798,12 +798,12 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
798 | GLint frames_per_swap = 0; | 798 | GLint frames_per_swap = 0; |
799 | if (disable_vsync) | 799 | if (disable_vsync) |
800 | { | 800 | { |
801 | llinfos << "Disabling vertical sync" << llendl; | 801 | LL_DEBUGS("GLInit") << "Disabling vertical sync" << LL_ENDL; |
802 | frames_per_swap = 0; | 802 | frames_per_swap = 0; |
803 | } | 803 | } |
804 | else | 804 | else |
805 | { | 805 | { |
806 | llinfos << "Keeping vertical sync" << llendl; | 806 | LL_DEBUGS("GLinit") << "Keeping vertical sync" << LL_ENDL; |
807 | frames_per_swap = 1; | 807 | frames_per_swap = 1; |
808 | } | 808 | } |
809 | aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap); | 809 | aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap); |
@@ -818,11 +818,11 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
818 | 818 | ||
819 | if (cgl_err != kCGLNoError ) | 819 | if (cgl_err != kCGLNoError ) |
820 | { | 820 | { |
821 | llinfos << "Multi-threaded OpenGL not available." << llendl; | 821 | LL_DEBUGS("GLInit") << "Multi-threaded OpenGL not available." << LL_ENDL; |
822 | } | 822 | } |
823 | else | 823 | else |
824 | { | 824 | { |
825 | llinfos << "Multi-threaded OpenGL enabled." << llendl; | 825 | LL_DEBUGS("GLInit") << "Multi-threaded OpenGL enabled." << LL_ENDL; |
826 | } | 826 | } |
827 | } | 827 | } |
828 | 828 | ||
@@ -869,11 +869,11 @@ BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, const LLCoordScreen &size, B | |||
869 | mFullscreenBits = CGDisplayBitsPerPixel(mDisplay); | 869 | mFullscreenBits = CGDisplayBitsPerPixel(mDisplay); |
870 | mFullscreenRefresh = llround(getDictDouble (CGDisplayCurrentMode (mDisplay), kCGDisplayRefreshRate)); | 870 | mFullscreenRefresh = llround(getDictDouble (CGDisplayCurrentMode (mDisplay), kCGDisplayRefreshRate)); |
871 | 871 | ||
872 | llinfos << "Switched resolution to " << mFullscreenWidth | 872 | LL_INFOS("Window") << "Switched resolution to " << mFullscreenWidth |
873 | << "x" << mFullscreenHeight | 873 | << "x" << mFullscreenHeight |
874 | << "x" << mFullscreenBits | 874 | << "x" << mFullscreenBits |
875 | << " @ " << mFullscreenRefresh | 875 | << " @ " << mFullscreenRefresh |
876 | << llendl; | 876 | << LL_ENDL; |
877 | 877 | ||
878 | // Update the GL context to the new screen size | 878 | // Update the GL context to the new screen size |
879 | if (!aglUpdateContext(mContext)) | 879 | if (!aglUpdateContext(mContext)) |
@@ -943,7 +943,7 @@ void LLWindowMacOSX::destroyContext() | |||
943 | // Unhook the GL context from any drawable it may have | 943 | // Unhook the GL context from any drawable it may have |
944 | if(mContext != NULL) | 944 | if(mContext != NULL) |
945 | { | 945 | { |
946 | llinfos << "destroyContext: unhooking drawable " << llendl; | 946 | LL_DEBUGS("Window") << "destroyContext: unhooking drawable " << LL_ENDL; |
947 | 947 | ||
948 | aglSetCurrentContext (NULL); | 948 | aglSetCurrentContext (NULL); |
949 | aglSetDrawable(mContext, NULL); | 949 | aglSetDrawable(mContext, NULL); |
@@ -952,7 +952,7 @@ void LLWindowMacOSX::destroyContext() | |||
952 | // Make sure the display resolution gets restored | 952 | // Make sure the display resolution gets restored |
953 | if(mOldDisplayMode != NULL) | 953 | if(mOldDisplayMode != NULL) |
954 | { | 954 | { |
955 | llinfos << "destroyContext: restoring display resolution " << llendl; | 955 | LL_DEBUGS("Window") << "destroyContext: restoring display resolution " << LL_ENDL; |
956 | 956 | ||
957 | CGDisplaySwitchToMode (mDisplay, mOldDisplayMode); | 957 | CGDisplaySwitchToMode (mDisplay, mOldDisplayMode); |
958 | 958 | ||
@@ -978,7 +978,7 @@ void LLWindowMacOSX::destroyContext() | |||
978 | // Clean up the pixel format | 978 | // Clean up the pixel format |
979 | if(mPixelFormat != NULL) | 979 | if(mPixelFormat != NULL) |
980 | { | 980 | { |
981 | llinfos << "destroyContext: destroying pixel format " << llendl; | 981 | LL_DEBUGS("Window") << "destroyContext: destroying pixel format " << LL_ENDL; |
982 | aglDestroyPixelFormat(mPixelFormat); | 982 | aglDestroyPixelFormat(mPixelFormat); |
983 | mPixelFormat = NULL; | 983 | mPixelFormat = NULL; |
984 | } | 984 | } |
@@ -986,14 +986,14 @@ void LLWindowMacOSX::destroyContext() | |||
986 | // Remove any Carbon Event handlers we installed | 986 | // Remove any Carbon Event handlers we installed |
987 | if(mGlobalHandlerRef != NULL) | 987 | if(mGlobalHandlerRef != NULL) |
988 | { | 988 | { |
989 | llinfos << "destroyContext: removing global event handler" << llendl; | 989 | LL_DEBUGS("Window") << "destroyContext: removing global event handler" << LL_ENDL; |
990 | RemoveEventHandler(mGlobalHandlerRef); | 990 | RemoveEventHandler(mGlobalHandlerRef); |
991 | mGlobalHandlerRef = NULL; | 991 | mGlobalHandlerRef = NULL; |
992 | } | 992 | } |
993 | 993 | ||
994 | if(mWindowHandlerRef != NULL) | 994 | if(mWindowHandlerRef != NULL) |
995 | { | 995 | { |
996 | llinfos << "destroyContext: removing window event handler" << llendl; | 996 | LL_DEBUGS("Window") << "destroyContext: removing window event handler" << LL_ENDL; |
997 | RemoveEventHandler(mWindowHandlerRef); | 997 | RemoveEventHandler(mWindowHandlerRef); |
998 | mWindowHandlerRef = NULL; | 998 | mWindowHandlerRef = NULL; |
999 | } | 999 | } |
@@ -1001,7 +1001,7 @@ void LLWindowMacOSX::destroyContext() | |||
1001 | // Cleanup any TSM document we created. | 1001 | // Cleanup any TSM document we created. |
1002 | if(mTSMDocument != NULL) | 1002 | if(mTSMDocument != NULL) |
1003 | { | 1003 | { |
1004 | llinfos << "destroyContext: deleting TSM document" << llendl; | 1004 | LL_DEBUGS("Window") << "destroyContext: deleting TSM document" << LL_ENDL; |
1005 | DeactivateTSMDocument(mTSMDocument); | 1005 | DeactivateTSMDocument(mTSMDocument); |
1006 | DeleteTSMDocument(mTSMDocument); | 1006 | DeleteTSMDocument(mTSMDocument); |
1007 | mTSMDocument = NULL; | 1007 | mTSMDocument = NULL; |
@@ -1010,7 +1010,7 @@ void LLWindowMacOSX::destroyContext() | |||
1010 | // Close the window | 1010 | // Close the window |
1011 | if(mWindow != NULL) | 1011 | if(mWindow != NULL) |
1012 | { | 1012 | { |
1013 | llinfos << "destroyContext: disposing window" << llendl; | 1013 | LL_DEBUGS("Window") << "destroyContext: disposing window" << LL_ENDL; |
1014 | DisposeWindow(mWindow); | 1014 | DisposeWindow(mWindow); |
1015 | mWindow = NULL; | 1015 | mWindow = NULL; |
1016 | } | 1016 | } |
@@ -1018,7 +1018,7 @@ void LLWindowMacOSX::destroyContext() | |||
1018 | // Clean up the GL context | 1018 | // Clean up the GL context |
1019 | if(mContext != NULL) | 1019 | if(mContext != NULL) |
1020 | { | 1020 | { |
1021 | llinfos << "destroyContext: destroying GL context" << llendl; | 1021 | LL_DEBUGS("Window") << "destroyContext: destroying GL context" << LL_ENDL; |
1022 | aglDestroyContext(mContext); | 1022 | aglDestroyContext(mContext); |
1023 | mContext = NULL; | 1023 | mContext = NULL; |
1024 | } | 1024 | } |
@@ -3394,4 +3394,13 @@ void LLWindowMacOSX::interruptLanguageTextInput() | |||
3394 | // Well, if Apple's TSM document is correct, we don't. | 3394 | // Well, if Apple's TSM document is correct, we don't. |
3395 | } | 3395 | } |
3396 | 3396 | ||
3397 | //static | ||
3398 | std::string LLWindowMacOSX::getFontListSans() | ||
3399 | { | ||
3400 | // This is a fairly complete Japanese font that ships with Mac OS X. | ||
3401 | // The first filename is in UTF8, but it shows up in the font menu as "Hiragino Kaku Gothic Pro W3". | ||
3402 | // The third filename is in UTF8, but it shows up in the font menu as "STHeiti Light" | ||
3403 | return "\xE3\x83\x92\xE3\x83\xA9\xE3\x82\xAD\xE3\x82\x99\xE3\x83\x8E\xE8\xA7\x92\xE3\x82\xB3\xE3\x82\x99 Pro W3.otf;\xE3\x83\x92\xE3\x83\xA9\xE3\x82\xAD\xE3\x82\x99\xE3\x83\x8E\xE8\xA7\x92\xE3\x82\xB3\xE3\x82\x99 ProN W3.otf;AppleGothic.dfont;AppleGothic.ttf;\xe5\x8d\x8e\xe6\x96\x87\xe7\xbb\x86\xe9\xbb\x91.ttf"; | ||
3404 | } | ||
3405 | |||
3397 | #endif // LL_DARWIN | 3406 | #endif // LL_DARWIN |
diff --git a/linden/indra/llwindow/llwindowmacosx.h b/linden/indra/llwindow/llwindowmacosx.h index 1edb218..d8a0788 100644 --- a/linden/indra/llwindow/llwindowmacosx.h +++ b/linden/indra/llwindow/llwindowmacosx.h | |||
@@ -116,6 +116,8 @@ public: | |||
116 | /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b); | 116 | /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b); |
117 | /*virtual*/ void interruptLanguageTextInput(); | 117 | /*virtual*/ void interruptLanguageTextInput(); |
118 | 118 | ||
119 | static std::string getFontListSans(); | ||
120 | |||
119 | protected: | 121 | protected: |
120 | LLWindowMacOSX( | 122 | LLWindowMacOSX( |
121 | char *title, char *name, int x, int y, int width, int height, U32 flags, | 123 | char *title, char *name, int x, int y, int width, int height, U32 flags, |
diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp index d9dc040..0d1d622 100644 --- a/linden/indra/llwindow/llwindowsdl.cpp +++ b/linden/indra/llwindow/llwindowsdl.cpp | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "llgl.h" | 39 | #include "llgl.h" |
40 | #include "llstring.h" | 40 | #include "llstring.h" |
41 | #include "lldir.h" | 41 | #include "lldir.h" |
42 | #include "llfindlocale.h" | ||
42 | 43 | ||
43 | #include "llglheaders.h" | 44 | #include "llglheaders.h" |
44 | 45 | ||
@@ -51,6 +52,10 @@ extern "C" { | |||
51 | #include <locale.h> | 52 | #include <locale.h> |
52 | #endif // LL_GTK | 53 | #endif // LL_GTK |
53 | 54 | ||
55 | extern "C" { | ||
56 | # include "fontconfig/fontconfig.h" | ||
57 | } | ||
58 | |||
54 | #if LL_LINUX || LL_SOLARIS | 59 | #if LL_LINUX || LL_SOLARIS |
55 | // not necessarily available on random SDL platforms, so #if LL_LINUX | 60 | // not necessarily available on random SDL platforms, so #if LL_LINUX |
56 | // for execv(), waitpid(), fork() | 61 | // for execv(), waitpid(), fork() |
@@ -2030,7 +2035,8 @@ void LLWindowSDL::gatherInput() | |||
2030 | // the locale to protect it, as exotic/non-C locales | 2035 | // the locale to protect it, as exotic/non-C locales |
2031 | // causes our code lots of general critical weirdness | 2036 | // causes our code lots of general critical weirdness |
2032 | // and crashness. (SL-35450) | 2037 | // and crashness. (SL-35450) |
2033 | std::string saved_locale = setlocale(LC_ALL, NULL); | 2038 | static std::string saved_locale; |
2039 | saved_locale = ll_safe_string(setlocale(LC_ALL, NULL)); | ||
2034 | 2040 | ||
2035 | // Pump until we've nothing left to do or passed 1/15th of a | 2041 | // Pump until we've nothing left to do or passed 1/15th of a |
2036 | // second pumping for this frame. | 2042 | // second pumping for this frame. |
@@ -2751,8 +2757,8 @@ void spawn_web_browser(const char* escaped_url) | |||
2751 | # endif // LL_X11 | 2757 | # endif // LL_X11 |
2752 | 2758 | ||
2753 | std::string cmd; | 2759 | std::string cmd; |
2754 | cmd = gDirUtilp->getAppRODataDir().c_str(); | 2760 | cmd = gDirUtilp->getAppRODataDir(); |
2755 | cmd += gDirUtilp->getDirDelimiter().c_str(); | 2761 | cmd += gDirUtilp->getDirDelimiter(); |
2756 | cmd += "launch_url.sh"; | 2762 | cmd += "launch_url.sh"; |
2757 | char* const argv[] = {(char*)cmd.c_str(), (char*)escaped_url, NULL}; | 2763 | char* const argv[] = {(char*)cmd.c_str(), (char*)escaped_url, NULL}; |
2758 | 2764 | ||
@@ -2829,4 +2835,90 @@ void LLWindowSDL::bringToFront() | |||
2829 | #endif // LL_X11 | 2835 | #endif // LL_X11 |
2830 | } | 2836 | } |
2831 | 2837 | ||
2838 | //static | ||
2839 | std::string LLWindowSDL::getFontListSans() | ||
2840 | { | ||
2841 | // Use libfontconfig to find us a nice ordered list of fallback fonts | ||
2842 | // specific to this system. | ||
2843 | std::string final_fallback("/usr/share/fonts/truetype/kochi/kochi-gothic.ttf"); | ||
2844 | // Our 'ideal' font properties which define the sorting results. | ||
2845 | // slant=0 means Roman, index=0 means the first face in a font file | ||
2846 | // (the one we actually use), weight=80 means medium weight, | ||
2847 | // spacing=0 means proportional spacing. | ||
2848 | std::string sort_order("slant=0:index=0:weight=80:spacing=0"); | ||
2849 | // elide_unicode_coverage removes fonts from the list whose unicode | ||
2850 | // range is covered by fonts earlier in the list. This usually | ||
2851 | // removes ~90% of the fonts as redundant (which is great because | ||
2852 | // the font list can be huge), but might unnecessarily reduce the | ||
2853 | // renderable range if for some reason our FreeType actually fails | ||
2854 | // to use some of the fonts we want it to. | ||
2855 | const bool elide_unicode_coverage = true; | ||
2856 | std::string rtn; | ||
2857 | FcFontSet *fs = NULL; | ||
2858 | FcPattern *sortpat = NULL; | ||
2859 | int font_count = 0; | ||
2860 | |||
2861 | llinfos << "Getting system font list from FontConfig..." << llendl; | ||
2862 | |||
2863 | // If the user has a system-wide language preference, then favor | ||
2864 | // fonts from that language group. This doesn't affect the types | ||
2865 | // of languages that can be displayed, but ensures that their | ||
2866 | // preferred language is rendered from a single consistent font where | ||
2867 | // possible. | ||
2868 | FL_Locale *locale = NULL; | ||
2869 | FL_Success success = FL_FindLocale(&locale, FL_MESSAGES); | ||
2870 | if (success != 0) | ||
2871 | { | ||
2872 | if (success >= 2 && locale->lang) // confident! | ||
2873 | { | ||
2874 | llinfos << "Preferring fonts of language: " | ||
2875 | << locale->lang | ||
2876 | << llendl; | ||
2877 | sort_order = "lang=" + std::string(locale->lang) + ":" | ||
2878 | + sort_order; | ||
2879 | } | ||
2880 | FL_FreeLocale(&locale); | ||
2881 | } | ||
2882 | |||
2883 | if (!FcInit()) | ||
2884 | { | ||
2885 | llwarns << "FontConfig failed to initialize." << llendl; | ||
2886 | return final_fallback; | ||
2887 | } | ||
2888 | |||
2889 | sortpat = FcNameParse((FcChar8*) sort_order.c_str()); | ||
2890 | if (sortpat) | ||
2891 | { | ||
2892 | // Sort the list of system fonts from most-to-least-desirable. | ||
2893 | fs = FcFontSort(NULL, sortpat, elide_unicode_coverage, | ||
2894 | NULL, NULL); | ||
2895 | FcPatternDestroy(sortpat); | ||
2896 | } | ||
2897 | |||
2898 | if (fs) | ||
2899 | { | ||
2900 | // Get the full pathnames to the fonts, where available, | ||
2901 | // which is what we really want. | ||
2902 | int i; | ||
2903 | for (i=0; i<fs->nfont; ++i) | ||
2904 | { | ||
2905 | FcChar8 *filename; | ||
2906 | if (FcResultMatch == FcPatternGetString(fs->fonts[i], | ||
2907 | FC_FILE, 0, | ||
2908 | &filename) | ||
2909 | && filename) | ||
2910 | { | ||
2911 | rtn += std::string((const char*)filename)+";"; | ||
2912 | ++font_count; | ||
2913 | } | ||
2914 | } | ||
2915 | FcFontSetDestroy (fs); | ||
2916 | } | ||
2917 | |||
2918 | lldebugs << "Using font list: " << rtn << llendl; | ||
2919 | llinfos << "Using " << font_count << " system font(s)." << llendl; | ||
2920 | |||
2921 | return rtn + final_fallback; | ||
2922 | } | ||
2923 | |||
2832 | #endif // LL_SDL | 2924 | #endif // LL_SDL |
diff --git a/linden/indra/llwindow/llwindowsdl.h b/linden/indra/llwindow/llwindowsdl.h index d1b2b77..5aed4e6 100644 --- a/linden/indra/llwindow/llwindowsdl.h +++ b/linden/indra/llwindow/llwindowsdl.h | |||
@@ -120,6 +120,8 @@ public: | |||
120 | /*virtual*/ void *getPlatformWindow(); | 120 | /*virtual*/ void *getPlatformWindow(); |
121 | /*virtual*/ void bringToFront(); | 121 | /*virtual*/ void bringToFront(); |
122 | 122 | ||
123 | static std::string getFontListSans(); | ||
124 | |||
123 | // Not great that these are public, but they have to be accessible | 125 | // Not great that these are public, but they have to be accessible |
124 | // by non-class code and it's better than making them global. | 126 | // by non-class code and it's better than making them global. |
125 | #if LL_X11 | 127 | #if LL_X11 |
@@ -154,7 +156,6 @@ protected: | |||
154 | 156 | ||
155 | BOOL shouldPostQuit() { return mPostQuit; } | 157 | BOOL shouldPostQuit() { return mPostQuit; } |
156 | 158 | ||
157 | |||
158 | protected: | 159 | protected: |
159 | // | 160 | // |
160 | // Platform specific methods | 161 | // Platform specific methods |
diff --git a/linden/indra/llwindow/llwindowsolaris.cpp b/linden/indra/llwindow/llwindowsolaris.cpp deleted file mode 100644 index 54a77ae..0000000 --- a/linden/indra/llwindow/llwindowsolaris.cpp +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /** | ||
2 | * @file fmodwrapper.cpp | ||
3 | * @brief dummy source file for building a shared library to wrap libfmod.a | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2005&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2005-2008, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
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 | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #if LL_SOLARIS | ||
33 | |||
34 | #include "linden_common.h" | ||
35 | #include "indra_constants.h" | ||
36 | |||
37 | #include "llwindowsolaris.h" | ||
38 | #include "llgl.h" | ||
39 | #include "llglheaders.h" | ||
40 | |||
41 | // | ||
42 | // LLWindowSolaris | ||
43 | // | ||
44 | LLWindowSolaris::LLWindowSolaris(char *title, char *name, S32 x, S32 y, S32 width, S32 height, | ||
45 | U32 flags, BOOL fullscreen, BOOL clearBg, | ||
46 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth) | ||
47 | : LLWindow(fullscreen, flags) | ||
48 | { | ||
49 | llerrs << "Solaris window not yet supported" << llendl; | ||
50 | } | ||
51 | |||
52 | |||
53 | LLWindowSolaris::~LLWindowSolaris() | ||
54 | { | ||
55 | } | ||
56 | |||
57 | void LLWindowSolaris::swapBuffers() | ||
58 | { | ||
59 | } | ||
60 | |||
61 | #endif // LL_SOLARIS | ||
diff --git a/linden/indra/llwindow/llwindowsolaris.h b/linden/indra/llwindow/llwindowsolaris.h deleted file mode 100644 index 7a271c0..0000000 --- a/linden/indra/llwindow/llwindowsolaris.h +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | /** | ||
2 | * @file fmodwrapper.cpp | ||
3 | * @brief dummy source file for building a shared library to wrap libfmod.a | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2005&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2005-2008, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
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 | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #ifndef LL_LLWINDOWSOLARIS_H | ||
33 | #define LL_LLWINDOWSOLARIS_H | ||
34 | |||
35 | #include "llwindow.h" | ||
36 | |||
37 | class LLWindowSolaris : public LLWindow | ||
38 | { | ||
39 | public: | ||
40 | /*virtual*/ void show() {}; | ||
41 | /*virtual*/ void hide() {}; | ||
42 | /*virtual*/ void close() {}; | ||
43 | /*virtual*/ BOOL getVisible() {return FALSE;}; | ||
44 | /*virtual*/ BOOL getMinimized() {return FALSE;}; | ||
45 | /*virtual*/ BOOL getMaximized() {return FALSE;}; | ||
46 | /*virtual*/ BOOL maximize() {return FALSE;}; | ||
47 | /*virtual*/ BOOL getFullscreen() {return FALSE;}; | ||
48 | /*virtual*/ BOOL getPosition(LLCoordScreen *position) {return FALSE;}; | ||
49 | /*virtual*/ BOOL getSize(LLCoordScreen *size) {return FALSE;}; | ||
50 | /*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;}; | ||
51 | /*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;}; | ||
52 | /*virtual*/ BOOL setSize(LLCoordScreen size) {return FALSE;}; | ||
53 | /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;}; | ||
54 | /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;}; | ||
55 | /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;}; | ||
56 | /*virtual*/ void showCursor() {}; | ||
57 | /*virtual*/ void hideCursor() {}; | ||
58 | /*virtual*/ void showCursorFromMouseMove() {}; | ||
59 | /*virtual*/ void hideCursorUntilMouseMove() {}; | ||
60 | /*virtual*/ BOOL isCursorHidden() {return FALSE;}; | ||
61 | /*virtual*/ void setCursor(ECursorType cursor) {}; | ||
62 | //virtual ECursorType getCursor() { return mCurrentCursor; }; | ||
63 | /*virtual*/ void captureMouse() {}; | ||
64 | /*virtual*/ void releaseMouse() {}; | ||
65 | /*virtual*/ void setMouseClipping( BOOL b ) {}; | ||
66 | /*virtual*/ BOOL isClipboardTextAvailable() {return FALSE; }; | ||
67 | /*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst) {return FALSE; }; | ||
68 | /*virtual*/ BOOL copyTextToClipboard(const LLWString &src) {return FALSE; }; | ||
69 | /*virtual*/ void flashIcon(F32 seconds) {}; | ||
70 | /*virtual*/ F32 getGamma() {return 1.0f; }; | ||
71 | /*virtual*/ BOOL setGamma(const F32 gamma) {return FALSE; }; // Set the gamma | ||
72 | /*virtual*/ U32 getFSAASamples() { return 0; } | ||
73 | /*virtual*/ void setFSAASamples(const U32 samples) { } | ||
74 | /*virtual*/ BOOL restoreGamma() {return FALSE; }; // Restore original gamma table (before updating gamma) | ||
75 | //virtual ESwapMethod getSwapMethod() { return mSwapMethod; } | ||
76 | /*virtual*/ void gatherInput() {}; | ||
77 | /*virtual*/ void delayInputProcessing() {}; | ||
78 | /*virtual*/ void swapBuffers(); | ||
79 | |||
80 | /*virtual*/ LLString getTempFileName() {return LLString(""); }; | ||
81 | /*virtual*/ void deleteFile( const char* file_name ) {}; | ||
82 | /*virtual*/ S32 stat( const char* file_name, struct stat* stat_info ) {return 0; }; | ||
83 | /*virtual*/ BOOL sendEmail(const char* address,const char* subject,const char* body_text,const char* attachment=NULL, const char* attachment_displayed_name=NULL) { return FALSE; }; | ||
84 | |||
85 | |||
86 | // handy coordinate space conversion routines | ||
87 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; }; | ||
88 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; }; | ||
89 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) { return FALSE; }; | ||
90 | /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordWindow *to) { return FALSE; }; | ||
91 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordGL *to) { return FALSE; }; | ||
92 | /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordScreen *to) { return FALSE; }; | ||
93 | |||
94 | /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) { return NULL; }; | ||
95 | /*virtual*/ F32 getNativeAspectRatio() { return 1.0f; }; | ||
96 | /*virtual*/ F32 getPixelAspectRatio() { return 1.0f; }; | ||
97 | /*virtual*/ void setNativeAspectRatio(F32 ratio) {} | ||
98 | |||
99 | //virtual BOOL dialog_color_picker (F32 *r, F32 *g, F32 *b ); | ||
100 | |||
101 | /*virtual*/ void *getPlatformWindow() { return NULL; } | ||
102 | |||
103 | LLWindowSolaris(char *title, char *name, S32 x, S32 y, S32 width, S32 height, | ||
104 | U32 flags, BOOL fullscreen, BOOL clearBg, | ||
105 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); | ||
106 | ~LLWindowSolaris(); | ||
107 | }; | ||
108 | |||
109 | class LLSplashScreenLinux : public LLSplashScreen | ||
110 | { | ||
111 | public: | ||
112 | LLSplashScreenLinux() {}; | ||
113 | virtual ~LLSplashScreenLinux() {}; | ||
114 | |||
115 | /*virtual*/ void showImpl() {}; | ||
116 | /*virtual*/ void updateImpl(const char* mesg) {}; | ||
117 | /*virtual*/ void hideImpl() {}; | ||
118 | |||
119 | }; | ||
120 | |||
121 | #endif //LL_LLWINDOWSOLARIS_H | ||
diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index 9963493..f2a2727 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp | |||
@@ -84,7 +84,7 @@ LLW32MsgCallback gAsyncMsgCallback = NULL; | |||
84 | 84 | ||
85 | void show_window_creation_error(const char* title) | 85 | void show_window_creation_error(const char* title) |
86 | { | 86 | { |
87 | llwarns << title << llendl; | 87 | LL_WARNS("Window") << title << LL_ENDL; |
88 | } | 88 | } |
89 | 89 | ||
90 | //static | 90 | //static |
@@ -534,7 +534,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
534 | 534 | ||
535 | if (closest_refresh == 0) | 535 | if (closest_refresh == 0) |
536 | { | 536 | { |
537 | llwarns << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << llendl; | 537 | LL_WARNS("Window") << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << LL_ENDL; |
538 | success = FALSE; | 538 | success = FALSE; |
539 | } | 539 | } |
540 | 540 | ||
@@ -557,11 +557,11 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
557 | mFullscreenBits = dev_mode.dmBitsPerPel; | 557 | mFullscreenBits = dev_mode.dmBitsPerPel; |
558 | mFullscreenRefresh = dev_mode.dmDisplayFrequency; | 558 | mFullscreenRefresh = dev_mode.dmDisplayFrequency; |
559 | 559 | ||
560 | llinfos << "Running at " << dev_mode.dmPelsWidth | 560 | LL_INFOS("Window") << "Running at " << dev_mode.dmPelsWidth |
561 | << "x" << dev_mode.dmPelsHeight | 561 | << "x" << dev_mode.dmPelsHeight |
562 | << "x" << dev_mode.dmBitsPerPel | 562 | << "x" << dev_mode.dmBitsPerPel |
563 | << " @ " << dev_mode.dmDisplayFrequency | 563 | << " @ " << dev_mode.dmDisplayFrequency |
564 | << llendl; | 564 | << LL_ENDL; |
565 | } | 565 | } |
566 | else | 566 | else |
567 | { | 567 | { |
@@ -576,7 +576,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
576 | OSMessageBox(error, "Error", OSMB_OK); | 576 | OSMessageBox(error, "Error", OSMB_OK); |
577 | } | 577 | } |
578 | } | 578 | } |
579 | 579 | ||
580 | // TODO: add this after resolving _WIN32_WINNT issue | 580 | // TODO: add this after resolving _WIN32_WINNT issue |
581 | // if (!fullscreen) | 581 | // if (!fullscreen) |
582 | // { | 582 | // { |
@@ -588,7 +588,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
588 | // TrackMouseEvent( &track_mouse_event ); | 588 | // TrackMouseEvent( &track_mouse_event ); |
589 | // } | 589 | // } |
590 | 590 | ||
591 | 591 | ||
592 | //----------------------------------------------------------------------- | 592 | //----------------------------------------------------------------------- |
593 | // Create GL drawing context | 593 | // Create GL drawing context |
594 | //----------------------------------------------------------------------- | 594 | //----------------------------------------------------------------------- |
@@ -657,7 +657,7 @@ void LLWindowWin32::restore() | |||
657 | // Usually called from LLWindowManager::destroyWindow() | 657 | // Usually called from LLWindowManager::destroyWindow() |
658 | void LLWindowWin32::close() | 658 | void LLWindowWin32::close() |
659 | { | 659 | { |
660 | llinfos << "Closing LLWindowWin32" << llendl; | 660 | LL_DEBUGS("Window") << "Closing LLWindowWin32" << LL_ENDL; |
661 | // Is window is already closed? | 661 | // Is window is already closed? |
662 | if (!mWindowHandle) | 662 | if (!mWindowHandle) |
663 | { | 663 | { |
@@ -675,20 +675,20 @@ void LLWindowWin32::close() | |||
675 | } | 675 | } |
676 | 676 | ||
677 | // Clean up remaining GL state | 677 | // Clean up remaining GL state |
678 | llinfos << "Shutting down GL" << llendl; | 678 | LL_DEBUGS("Window") << "Shutting down GL" << LL_ENDL; |
679 | gGLManager.shutdownGL(); | 679 | gGLManager.shutdownGL(); |
680 | 680 | ||
681 | llinfos << "Releasing Context" << llendl; | 681 | LL_DEBUGS("Window") << "Releasing Context" << LL_ENDL; |
682 | if (mhRC) | 682 | if (mhRC) |
683 | { | 683 | { |
684 | if (!wglMakeCurrent(NULL, NULL)) | 684 | if (!wglMakeCurrent(NULL, NULL)) |
685 | { | 685 | { |
686 | llwarns << "Release of DC and RC failed" << llendl; | 686 | LL_WARNS("Window") << "Release of DC and RC failed" << LL_ENDL; |
687 | } | 687 | } |
688 | 688 | ||
689 | if (!wglDeleteContext(mhRC)) | 689 | if (!wglDeleteContext(mhRC)) |
690 | { | 690 | { |
691 | llwarns << "Release of rendering context failed" << llendl; | 691 | LL_WARNS("Window") << "Release of rendering context failed" << LL_ENDL; |
692 | } | 692 | } |
693 | 693 | ||
694 | mhRC = NULL; | 694 | mhRC = NULL; |
@@ -699,11 +699,11 @@ void LLWindowWin32::close() | |||
699 | 699 | ||
700 | if (mhDC && !ReleaseDC(mWindowHandle, mhDC)) | 700 | if (mhDC && !ReleaseDC(mWindowHandle, mhDC)) |
701 | { | 701 | { |
702 | llwarns << "Release of ghDC failed" << llendl; | 702 | LL_WARNS("Window") << "Release of ghDC failed" << LL_ENDL; |
703 | mhDC = NULL; | 703 | mhDC = NULL; |
704 | } | 704 | } |
705 | 705 | ||
706 | llinfos << "Destroying Window" << llendl; | 706 | LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL; |
707 | 707 | ||
708 | // Don't process events in our mainWindowProc any longer. | 708 | // Don't process events in our mainWindowProc any longer. |
709 | SetWindowLong(mWindowHandle, GWL_USERDATA, NULL); | 709 | SetWindowLong(mWindowHandle, GWL_USERDATA, NULL); |
@@ -866,12 +866,12 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
866 | { | 866 | { |
867 | if (!wglMakeCurrent(NULL, NULL)) | 867 | if (!wglMakeCurrent(NULL, NULL)) |
868 | { | 868 | { |
869 | llwarns << "Release of DC and RC failed" << llendl; | 869 | LL_WARNS("Window") << "Release of DC and RC failed" << LL_ENDL; |
870 | } | 870 | } |
871 | 871 | ||
872 | if (!wglDeleteContext(mhRC)) | 872 | if (!wglDeleteContext(mhRC)) |
873 | { | 873 | { |
874 | llwarns << "Release of rendering context failed" << llendl; | 874 | LL_WARNS("Window") << "Release of rendering context failed" << LL_ENDL; |
875 | } | 875 | } |
876 | 876 | ||
877 | mhRC = NULL; | 877 | mhRC = NULL; |
@@ -905,7 +905,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
905 | 905 | ||
906 | if (closest_refresh == 0) | 906 | if (closest_refresh == 0) |
907 | { | 907 | { |
908 | llwarns << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << llendl; | 908 | LL_WARNS("Window") << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << LL_ENDL; |
909 | return FALSE; | 909 | return FALSE; |
910 | } | 910 | } |
911 | 911 | ||
@@ -927,11 +927,11 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
927 | mFullscreenBits = dev_mode.dmBitsPerPel; | 927 | mFullscreenBits = dev_mode.dmBitsPerPel; |
928 | mFullscreenRefresh = dev_mode.dmDisplayFrequency; | 928 | mFullscreenRefresh = dev_mode.dmDisplayFrequency; |
929 | 929 | ||
930 | llinfos << "Running at " << dev_mode.dmPelsWidth | 930 | LL_INFOS("Window") << "Running at " << dev_mode.dmPelsWidth |
931 | << "x" << dev_mode.dmPelsHeight | 931 | << "x" << dev_mode.dmPelsHeight |
932 | << "x" << dev_mode.dmBitsPerPel | 932 | << "x" << dev_mode.dmBitsPerPel |
933 | << " @ " << dev_mode.dmDisplayFrequency | 933 | << " @ " << dev_mode.dmDisplayFrequency |
934 | << llendl; | 934 | << LL_ENDL; |
935 | 935 | ||
936 | window_rect.left = (long) 0; | 936 | window_rect.left = (long) 0; |
937 | window_rect.right = (long) width; // Windows GDI rects don't include rightmost pixel | 937 | window_rect.right = (long) width; // Windows GDI rects don't include rightmost pixel |
@@ -952,8 +952,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
952 | mFullscreenBits = -1; | 952 | mFullscreenBits = -1; |
953 | mFullscreenRefresh = -1; | 953 | mFullscreenRefresh = -1; |
954 | 954 | ||
955 | llinfos << "Unable to run fullscreen at " << width << "x" << height << llendl; | 955 | LL_INFOS("Window") << "Unable to run fullscreen at " << width << "x" << height << LL_ENDL; |
956 | llinfos << "Running in window." << llendl; | ||
957 | return FALSE; | 956 | return FALSE; |
958 | } | 957 | } |
959 | } | 958 | } |
@@ -1146,7 +1145,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1146 | { | 1145 | { |
1147 | if (end_attrib > 0) | 1146 | if (end_attrib > 0) |
1148 | { | 1147 | { |
1149 | llinfos << "No valid pixel format for " << mFSAASamples << "x anti-aliasing." << llendl; | 1148 | LL_INFOS("Window") << "No valid pixel format for " << mFSAASamples << "x anti-aliasing." << LL_ENDL; |
1150 | attrib_list[end_attrib] = 0; | 1149 | attrib_list[end_attrib] = 0; |
1151 | 1150 | ||
1152 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); | 1151 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); |
@@ -1160,7 +1159,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1160 | 1159 | ||
1161 | if (!num_formats) | 1160 | if (!num_formats) |
1162 | { | 1161 | { |
1163 | llinfos << "No 32 bit z-buffer, trying 24 bits instead" << llendl; | 1162 | LL_INFOS("Window") << "No 32 bit z-buffer, trying 24 bits instead" << LL_ENDL; |
1164 | // Try 24-bit format | 1163 | // Try 24-bit format |
1165 | attrib_list[1] = 24; | 1164 | attrib_list[1] = 24; |
1166 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); | 1165 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); |
@@ -1173,7 +1172,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1173 | 1172 | ||
1174 | if (!num_formats) | 1173 | if (!num_formats) |
1175 | { | 1174 | { |
1176 | llwarns << "Couldn't get 24 bit z-buffer,trying 16 bits instead!" << llendl; | 1175 | LL_WARNS("Window") << "Couldn't get 24 bit z-buffer,trying 16 bits instead!" << LL_ENDL; |
1177 | attrib_list[1] = 16; | 1176 | attrib_list[1] = 16; |
1178 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); | 1177 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); |
1179 | if (!result || !num_formats) | 1178 | if (!result || !num_formats) |
@@ -1185,7 +1184,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1185 | } | 1184 | } |
1186 | } | 1185 | } |
1187 | 1186 | ||
1188 | llinfos << "Choosing pixel formats: " << num_formats << " pixel formats returned" << llendl; | 1187 | LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL; |
1189 | } | 1188 | } |
1190 | 1189 | ||
1191 | pixel_format = pixel_formats[0]; | 1190 | pixel_format = pixel_formats[0]; |
@@ -1241,26 +1240,26 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1241 | { | 1240 | { |
1242 | case WGL_SWAP_EXCHANGE_ARB: | 1241 | case WGL_SWAP_EXCHANGE_ARB: |
1243 | mSwapMethod = SWAP_METHOD_EXCHANGE; | 1242 | mSwapMethod = SWAP_METHOD_EXCHANGE; |
1244 | llinfos << "Swap Method: Exchange" << llendl; | 1243 | LL_DEBUGS("Window") << "Swap Method: Exchange" << LL_ENDL; |
1245 | break; | 1244 | break; |
1246 | case WGL_SWAP_COPY_ARB: | 1245 | case WGL_SWAP_COPY_ARB: |
1247 | mSwapMethod = SWAP_METHOD_COPY; | 1246 | mSwapMethod = SWAP_METHOD_COPY; |
1248 | llinfos << "Swap Method: Copy" << llendl; | 1247 | LL_DEBUGS("Window") << "Swap Method: Copy" << LL_ENDL; |
1249 | break; | 1248 | break; |
1250 | case WGL_SWAP_UNDEFINED_ARB: | 1249 | case WGL_SWAP_UNDEFINED_ARB: |
1251 | mSwapMethod = SWAP_METHOD_UNDEFINED; | 1250 | mSwapMethod = SWAP_METHOD_UNDEFINED; |
1252 | llinfos << "Swap Method: Undefined" << llendl; | 1251 | LL_DEBUGS("Window") << "Swap Method: Undefined" << LL_ENDL; |
1253 | break; | 1252 | break; |
1254 | default: | 1253 | default: |
1255 | mSwapMethod = SWAP_METHOD_UNDEFINED; | 1254 | mSwapMethod = SWAP_METHOD_UNDEFINED; |
1256 | llinfos << "Swap Method: Unknown" << llendl; | 1255 | LL_DEBUGS("Window") << "Swap Method: Unknown" << LL_ENDL; |
1257 | break; | 1256 | break; |
1258 | } | 1257 | } |
1259 | } | 1258 | } |
1260 | } | 1259 | } |
1261 | else | 1260 | else |
1262 | { | 1261 | { |
1263 | llwarns << "No wgl_ARB_pixel_format extension, using default ChoosePixelFormat!" << llendl; | 1262 | LL_WARNS("Window") << "No wgl_ARB_pixel_format extension, using default ChoosePixelFormat!" << LL_ENDL; |
1264 | } | 1263 | } |
1265 | 1264 | ||
1266 | // Verify what pixel format we actually received. | 1265 | // Verify what pixel format we actually received. |
@@ -1272,10 +1271,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1272 | return FALSE; | 1271 | return FALSE; |
1273 | } | 1272 | } |
1274 | 1273 | ||
1275 | llinfos << "GL buffer: Color Bits " << S32(pfd.cColorBits) | 1274 | LL_INFOS("Window") << "GL buffer: Color Bits " << S32(pfd.cColorBits) |
1276 | << " Alpha Bits " << S32(pfd.cAlphaBits) | 1275 | << " Alpha Bits " << S32(pfd.cAlphaBits) |
1277 | << " Depth Bits " << S32(pfd.cDepthBits) | 1276 | << " Depth Bits " << S32(pfd.cDepthBits) |
1278 | << llendl; | 1277 | << LL_ENDL; |
1279 | 1278 | ||
1280 | // make sure we have 32 bits per pixel | 1279 | // make sure we have 32 bits per pixel |
1281 | if (pfd.cColorBits < 32 || GetDeviceCaps(mhDC, BITSPIXEL) < 32) | 1280 | if (pfd.cColorBits < 32 || GetDeviceCaps(mhDC, BITSPIXEL) < 32) |
@@ -1338,12 +1337,12 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1338 | // Disable vertical sync for swap | 1337 | // Disable vertical sync for swap |
1339 | if (disable_vsync && wglSwapIntervalEXT) | 1338 | if (disable_vsync && wglSwapIntervalEXT) |
1340 | { | 1339 | { |
1341 | llinfos << "Disabling vertical sync" << llendl; | 1340 | LL_DEBUGS("Window") << "Disabling vertical sync" << LL_ENDL; |
1342 | wglSwapIntervalEXT(0); | 1341 | wglSwapIntervalEXT(0); |
1343 | } | 1342 | } |
1344 | else | 1343 | else |
1345 | { | 1344 | { |
1346 | llinfos << "Keeping vertical sync" << llendl; | 1345 | LL_DEBUGS("Window") << "Keeping vertical sync" << LL_ENDL; |
1347 | } | 1346 | } |
1348 | 1347 | ||
1349 | SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this); | 1348 | SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this); |
@@ -1701,11 +1700,11 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1701 | 1700 | ||
1702 | if (gDebugWindowProc) | 1701 | if (gDebugWindowProc) |
1703 | { | 1702 | { |
1704 | llinfos << "WINDOWPROC ActivateApp " | 1703 | LL_INFOS("Window") << "WINDOWPROC ActivateApp " |
1705 | << " activating " << S32(activating) | 1704 | << " activating " << S32(activating) |
1706 | << " minimized " << S32(minimized) | 1705 | << " minimized " << S32(minimized) |
1707 | << " fullscreen " << S32(window_imp->mFullscreen) | 1706 | << " fullscreen " << S32(window_imp->mFullscreen) |
1708 | << llendl; | 1707 | << LL_ENDL; |
1709 | } | 1708 | } |
1710 | 1709 | ||
1711 | if (window_imp->mFullscreen) | 1710 | if (window_imp->mFullscreen) |
@@ -1746,10 +1745,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1746 | // properly when we run fullscreen. | 1745 | // properly when we run fullscreen. |
1747 | if (gDebugWindowProc) | 1746 | if (gDebugWindowProc) |
1748 | { | 1747 | { |
1749 | llinfos << "WINDOWPROC Activate " | 1748 | LL_INFOS("Window") << "WINDOWPROC Activate " |
1750 | << " activating " << S32(activating) | 1749 | << " activating " << S32(activating) |
1751 | << " minimized " << S32(minimized) | 1750 | << " minimized " << S32(minimized) |
1752 | << llendl; | 1751 | << LL_ENDL; |
1753 | } | 1752 | } |
1754 | 1753 | ||
1755 | // Don't handle this. | 1754 | // Don't handle this. |
@@ -1805,9 +1804,9 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1805 | { | 1804 | { |
1806 | if (gDebugWindowProc) | 1805 | if (gDebugWindowProc) |
1807 | { | 1806 | { |
1808 | llinfos << "Debug WindowProc WM_KEYDOWN " | 1807 | LL_INFOS("Window") << "Debug WindowProc WM_KEYDOWN " |
1809 | << " key " << S32(w_param) | 1808 | << " key " << S32(w_param) |
1810 | << llendl; | 1809 | << LL_ENDL; |
1811 | } | 1810 | } |
1812 | if(gKeyboard->handleKeyDown(w_param, mask) && eat_keystroke) | 1811 | if(gKeyboard->handleKeyDown(w_param, mask) && eat_keystroke) |
1813 | { | 1812 | { |
@@ -1824,9 +1823,9 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1824 | 1823 | ||
1825 | if (gDebugWindowProc) | 1824 | if (gDebugWindowProc) |
1826 | { | 1825 | { |
1827 | llinfos << "Debug WindowProc WM_KEYUP " | 1826 | LL_INFOS("Window") << "Debug WindowProc WM_KEYUP " |
1828 | << " key " << S32(w_param) | 1827 | << " key " << S32(w_param) |
1829 | << llendl; | 1828 | << LL_ENDL; |
1830 | } | 1829 | } |
1831 | if (gKeyboard->handleKeyUp(w_param, mask) && eat_keystroke) | 1830 | if (gKeyboard->handleKeyUp(w_param, mask) && eat_keystroke) |
1832 | { | 1831 | { |
@@ -1909,13 +1908,11 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1909 | // it is worth trying. The good old WM_CHAR works just fine even for supplementary | 1908 | // it is worth trying. The good old WM_CHAR works just fine even for supplementary |
1910 | // characters. We just need to take care of surrogate pairs sent as two WM_CHAR's | 1909 | // characters. We just need to take care of surrogate pairs sent as two WM_CHAR's |
1911 | // by ourselves. It is not that tough. -- Alissa Sabre @ SL | 1910 | // by ourselves. It is not that tough. -- Alissa Sabre @ SL |
1912 | // | ||
1913 | // llinfos << "WM_CHAR: " << w_param << llendl; | ||
1914 | if (gDebugWindowProc) | 1911 | if (gDebugWindowProc) |
1915 | { | 1912 | { |
1916 | llinfos << "Debug WindowProc WM_CHAR " | 1913 | LL_INFOS("Window") << "Debug WindowProc WM_CHAR " |
1917 | << " key " << S32(w_param) | 1914 | << " key " << S32(w_param) |
1918 | << llendl; | 1915 | << LL_ENDL; |
1919 | } | 1916 | } |
1920 | // Even if LLWindowCallbacks::handleUnicodeChar(llwchar, BOOL) returned FALSE, | 1917 | // Even if LLWindowCallbacks::handleUnicodeChar(llwchar, BOOL) returned FALSE, |
1921 | // we *did* processed the event, so I believe we should not pass it to DefWindowProc... | 1918 | // we *did* processed the event, so I believe we should not pass it to DefWindowProc... |
@@ -1985,7 +1982,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1985 | LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER); | 1982 | LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER); |
1986 | //if (gDebugClicks) | 1983 | //if (gDebugClicks) |
1987 | //{ | 1984 | //{ |
1988 | // llinfos << "WndProc left button up" << llendl; | 1985 | // LL_INFOS("Window") << "WndProc left button up" << LL_ENDL; |
1989 | //} | 1986 | //} |
1990 | // Because we move the cursor position in the app, we need to query | 1987 | // Because we move the cursor position in the app, we need to query |
1991 | // to find out where the cursor at the time the event is handled. | 1988 | // to find out where the cursor at the time the event is handled. |
@@ -2181,12 +2178,12 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
2181 | BOOL restored = ( w_param == SIZE_RESTORED ); | 2178 | BOOL restored = ( w_param == SIZE_RESTORED ); |
2182 | BOOL minimized = ( w_param == SIZE_MINIMIZED ); | 2179 | BOOL minimized = ( w_param == SIZE_MINIMIZED ); |
2183 | 2180 | ||
2184 | llinfos << "WINDOWPROC Size " | 2181 | LL_INFOS("Window") << "WINDOWPROC Size " |
2185 | << width << "x" << height | 2182 | << width << "x" << height |
2186 | << " max " << S32(maximized) | 2183 | << " max " << S32(maximized) |
2187 | << " min " << S32(minimized) | 2184 | << " min " << S32(minimized) |
2188 | << " rest " << S32(restored) | 2185 | << " rest " << S32(restored) |
2189 | << llendl; | 2186 | << LL_ENDL; |
2190 | } | 2187 | } |
2191 | 2188 | ||
2192 | // There's an odd behavior with WM_SIZE that I would call a bug. If | 2189 | // There's an odd behavior with WM_SIZE that I would call a bug. If |
@@ -2232,7 +2229,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
2232 | case WM_SETFOCUS: | 2229 | case WM_SETFOCUS: |
2233 | if (gDebugWindowProc) | 2230 | if (gDebugWindowProc) |
2234 | { | 2231 | { |
2235 | llinfos << "WINDOWPROC SetFocus" << llendl; | 2232 | LL_INFOS("Window") << "WINDOWPROC SetFocus" << LL_ENDL; |
2236 | } | 2233 | } |
2237 | window_imp->mCallbacks->handleFocus(window_imp); | 2234 | window_imp->mCallbacks->handleFocus(window_imp); |
2238 | return 0; | 2235 | return 0; |
@@ -2240,7 +2237,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
2240 | case WM_KILLFOCUS: | 2237 | case WM_KILLFOCUS: |
2241 | if (gDebugWindowProc) | 2238 | if (gDebugWindowProc) |
2242 | { | 2239 | { |
2243 | llinfos << "WINDOWPROC KillFocus" << llendl; | 2240 | LL_INFOS("Window") << "WINDOWPROC KillFocus" << LL_ENDL; |
2244 | } | 2241 | } |
2245 | window_imp->mCallbacks->handleFocusLost(window_imp); | 2242 | window_imp->mCallbacks->handleFocusLost(window_imp); |
2246 | return 0; | 2243 | return 0; |
@@ -2596,7 +2593,7 @@ BOOL LLWindowWin32::setGamma(const F32 gamma) | |||
2596 | { | 2593 | { |
2597 | mCurrentGamma = gamma; | 2594 | mCurrentGamma = gamma; |
2598 | 2595 | ||
2599 | llinfos << "Setting gamma to " << gamma << llendl; | 2596 | LL_DEBUGS("Window") << "Setting gamma to " << gamma << LL_ENDL; |
2600 | 2597 | ||
2601 | for ( int i = 0; i < 256; ++i ) | 2598 | for ( int i = 0; i < 256; ++i ) |
2602 | { | 2599 | { |
@@ -2737,8 +2734,8 @@ BOOL LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 re | |||
2737 | 2734 | ||
2738 | if (!success) | 2735 | if (!success) |
2739 | { | 2736 | { |
2740 | llwarns << "setDisplayResolution failed, " | 2737 | LL_WARNS("Window") << "setDisplayResolution failed, " |
2741 | << width << "x" << height << "x" << bits << " @ " << refresh << llendl; | 2738 | << width << "x" << height << "x" << bits << " @ " << refresh << LL_ENDL; |
2742 | } | 2739 | } |
2743 | 2740 | ||
2744 | return success; | 2741 | return success; |
@@ -2760,7 +2757,7 @@ BOOL LLWindowWin32::setFullscreenResolution() | |||
2760 | // protected | 2757 | // protected |
2761 | BOOL LLWindowWin32::resetDisplayResolution() | 2758 | BOOL LLWindowWin32::resetDisplayResolution() |
2762 | { | 2759 | { |
2763 | llinfos << "resetDisplayResolution START" << llendl; | 2760 | LL_DEBUGS("Window") << "resetDisplayResolution START" << LL_ENDL; |
2764 | 2761 | ||
2765 | LONG cds_result = ChangeDisplaySettings(NULL, 0); | 2762 | LONG cds_result = ChangeDisplaySettings(NULL, 0); |
2766 | 2763 | ||
@@ -2768,10 +2765,10 @@ BOOL LLWindowWin32::resetDisplayResolution() | |||
2768 | 2765 | ||
2769 | if (!success) | 2766 | if (!success) |
2770 | { | 2767 | { |
2771 | llwarns << "resetDisplayResolution failed" << llendl; | 2768 | LL_WARNS("Window") << "resetDisplayResolution failed" << LL_ENDL; |
2772 | } | 2769 | } |
2773 | 2770 | ||
2774 | llinfos << "resetDisplayResolution END" << llendl; | 2771 | LL_DEBUGS("Window") << "resetDisplayResolution END" << LL_ENDL; |
2775 | 2772 | ||
2776 | return success; | 2773 | return success; |
2777 | } | 2774 | } |
@@ -2908,11 +2905,11 @@ void spawn_web_browser(const char* escaped_url ) | |||
2908 | 2905 | ||
2909 | if (!found) | 2906 | if (!found) |
2910 | { | 2907 | { |
2911 | llwarns << "spawn_web_browser() called for url with protocol not on whitelist: " << escaped_url << llendl; | 2908 | LL_WARNS("Window") << "spawn_web_browser() called for url with protocol not on whitelist: " << escaped_url << LL_ENDL; |
2912 | return; | 2909 | return; |
2913 | } | 2910 | } |
2914 | 2911 | ||
2915 | llinfos << "Opening URL " << escaped_url << llendl; | 2912 | LL_INFOS("Window") << "Opening URL " << escaped_url << LL_ENDL; |
2916 | 2913 | ||
2917 | // replaced ShellExecute code with ShellExecuteEx since ShellExecute doesn't work | 2914 | // replaced ShellExecute code with ShellExecuteEx since ShellExecute doesn't work |
2918 | // reliablly on Vista. | 2915 | // reliablly on Vista. |
@@ -2952,7 +2949,7 @@ void spawn_web_browser(const char* escaped_url ) | |||
2952 | 2949 | ||
2953 | if (browser_open_wstring.length() < 2) | 2950 | if (browser_open_wstring.length() < 2) |
2954 | { | 2951 | { |
2955 | llwarns << "Invalid browser executable in registry " << browser_open_wstring << llendl; | 2952 | LL_WARNS("Window") << "Invalid browser executable in registry " << browser_open_wstring << LL_ENDL; |
2956 | return; | 2953 | return; |
2957 | } | 2954 | } |
2958 | 2955 | ||
@@ -2972,8 +2969,8 @@ void spawn_web_browser(const char* escaped_url ) | |||
2972 | browser_executable = browser_open_wstring.substr(0, space_pos); | 2969 | browser_executable = browser_open_wstring.substr(0, space_pos); |
2973 | } | 2970 | } |
2974 | 2971 | ||
2975 | llinfos << "Browser reg key: " << wstring_to_utf8str(browser_open_wstring) << llendl; | 2972 | LL_DEBUGS("Window") << "Browser reg key: " << wstring_to_utf8str(browser_open_wstring) << LL_ENDL; |
2976 | llinfos << "Browser executable: " << wstring_to_utf8str(browser_executable) << llendl; | 2973 | LL_INFOS("Window") << "Browser executable: " << wstring_to_utf8str(browser_executable) << LL_ENDL; |
2977 | 2974 | ||
2978 | // Convert URL to wide string for Windows API | 2975 | // Convert URL to wide string for Windows API |
2979 | // Assume URL is UTF8, as can come from scripts | 2976 | // Assume URL is UTF8, as can come from scripts |
@@ -2995,11 +2992,11 @@ void spawn_web_browser(const char* escaped_url ) | |||
2995 | SW_SHOWNORMAL); | 2992 | SW_SHOWNORMAL); |
2996 | if (retval > 32) | 2993 | if (retval > 32) |
2997 | { | 2994 | { |
2998 | llinfos << "load_url success with " << retval << llendl; | 2995 | LL_DEBUGS("Window") << "load_url success with " << retval << LL_ENDL; |
2999 | } | 2996 | } |
3000 | else | 2997 | else |
3001 | { | 2998 | { |
3002 | llinfos << "load_url failure with " << retval << llendl; | 2999 | LL_INFOS("Window") << "load_url failure with " << retval << LL_ENDL; |
3003 | } | 3000 | } |
3004 | */ | 3001 | */ |
3005 | } | 3002 | } |
@@ -3541,7 +3538,7 @@ BOOL LLWindowWin32::handleImeRequests(U32 request, U32 param, LRESULT *result) | |||
3541 | 3538 | ||
3542 | if (!mPreeditor->getPreeditLocation(position, &caret_coord, &preedit_bounds, &text_control)) | 3539 | if (!mPreeditor->getPreeditLocation(position, &caret_coord, &preedit_bounds, &text_control)) |
3543 | { | 3540 | { |
3544 | llwarns << "*** IMR_QUERYCHARPOSITON called but getPreeditLocation failed." << llendl; | 3541 | LL_WARNS("Window") << "*** IMR_QUERYCHARPOSITON called but getPreeditLocation failed." << LL_ENDL; |
3545 | return FALSE; | 3542 | return FALSE; |
3546 | } | 3543 | } |
3547 | fillCharPosition(caret_coord, preedit_bounds, text_control, char_position); | 3544 | fillCharPosition(caret_coord, preedit_bounds, text_control, char_position); |
@@ -3628,5 +3625,13 @@ BOOL LLWindowWin32::handleImeRequests(U32 request, U32 param, LRESULT *result) | |||
3628 | return FALSE; | 3625 | return FALSE; |
3629 | } | 3626 | } |
3630 | 3627 | ||
3628 | //static | ||
3629 | std::string LLWindowWin32::getFontListSans() | ||
3630 | { | ||
3631 | // Lists Japanese, Korean, and Chinese sanserif fonts available in | ||
3632 | // Windows XP and Vista, as well as "Arial Unicode MS". | ||
3633 | return "MSGOTHIC.TTC;gulim.ttc;simhei.ttf;ArialUni.ttf"; | ||
3634 | } | ||
3635 | |||
3631 | 3636 | ||
3632 | #endif // LL_WINDOWS | 3637 | #endif // LL_WINDOWS |
diff --git a/linden/indra/llwindow/llwindowwin32.h b/linden/indra/llwindow/llwindowwin32.h index 5535af4..feb1c74 100644 --- a/linden/indra/llwindow/llwindowwin32.h +++ b/linden/indra/llwindow/llwindowwin32.h | |||
@@ -116,6 +116,8 @@ public: | |||
116 | /*virtual*/ void updateLanguageTextInputArea(); | 116 | /*virtual*/ void updateLanguageTextInputArea(); |
117 | /*virtual*/ void interruptLanguageTextInput(); | 117 | /*virtual*/ void interruptLanguageTextInput(); |
118 | 118 | ||
119 | static std::string getFontListSans(); | ||
120 | |||
119 | protected: | 121 | protected: |
120 | LLWindowWin32( | 122 | LLWindowWin32( |
121 | char *title, char *name, int x, int y, int width, int height, U32 flags, | 123 | char *title, char *name, int x, int y, int width, int height, U32 flags, |