diff options
author | Jacek Antonelli | 2008-08-15 23:45:19 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:19 -0500 |
commit | b235c59d60472f818a9142c0886b95a0ff4191d7 (patch) | |
tree | d323c55587584b19cc43a03f58a178823f12d3cd /linden/indra/llwindow | |
parent | Second Life viewer sources 1.18.5.3 (diff) | |
download | meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.zip meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.tar.gz meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.tar.bz2 meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.tar.xz |
Second Life viewer sources 1.18.6.0-RC
Diffstat (limited to 'linden/indra/llwindow')
-rw-r--r-- | linden/indra/llwindow/lldxhardware.cpp | 102 | ||||
-rw-r--r-- | linden/indra/llwindow/lldxhardware.h | 3 | ||||
-rw-r--r-- | linden/indra/llwindow/llgl.cpp | 19 | ||||
-rw-r--r-- | linden/indra/llwindow/llgl.h | 3 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowwin32.cpp | 7 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowwin32.h | 1 |
6 files changed, 133 insertions, 2 deletions
diff --git a/linden/indra/llwindow/lldxhardware.cpp b/linden/indra/llwindow/lldxhardware.cpp index 1a39e68..2aff052 100644 --- a/linden/indra/llwindow/lldxhardware.cpp +++ b/linden/indra/llwindow/lldxhardware.cpp | |||
@@ -411,6 +411,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
411 | } | 411 | } |
412 | 412 | ||
413 | std::string device_name = get_string(device_containerp, L"szDescription"); | 413 | std::string device_name = get_string(device_containerp, L"szDescription"); |
414 | |||
414 | std::string device_id = get_string(device_containerp, L"szDeviceID"); | 415 | std::string device_id = get_string(device_containerp, L"szDeviceID"); |
415 | 416 | ||
416 | LLDXDevice *dxdevicep = new LLDXDevice; | 417 | LLDXDevice *dxdevicep = new LLDXDevice; |
@@ -451,6 +452,8 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
451 | } | 452 | } |
452 | 453 | ||
453 | 454 | ||
455 | |||
456 | |||
454 | // Now, iterate through the related drivers | 457 | // Now, iterate through the related drivers |
455 | hr = device_containerp->GetChildContainer(L"Drivers", &driver_containerp); | 458 | hr = device_containerp->GetChildContainer(L"Drivers", &driver_containerp); |
456 | if (FAILED(hr) || !driver_containerp) | 459 | if (FAILED(hr) || !driver_containerp) |
@@ -468,6 +471,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) | |||
468 | S32 file_num = 0; | 471 | S32 file_num = 0; |
469 | for (file_num = 0; file_num < (S32)num_files; file_num++ ) | 472 | for (file_num = 0; file_num < (S32)num_files; file_num++ ) |
470 | { | 473 | { |
474 | |||
471 | hr = driver_containerp->EnumChildContainerNames(file_num, wszContainer, 256); | 475 | hr = driver_containerp->EnumChildContainerNames(file_num, wszContainer, 256); |
472 | if (FAILED(hr)) | 476 | if (FAILED(hr)) |
473 | { | 477 | { |
@@ -522,6 +526,104 @@ LCleanup: | |||
522 | return ok; | 526 | return ok; |
523 | } | 527 | } |
524 | 528 | ||
529 | LLSD LLDXHardware::getDisplayInfo() | ||
530 | { | ||
531 | LLTimer hw_timer; | ||
532 | HRESULT hr; | ||
533 | LLSD ret; | ||
534 | CoInitialize(NULL); | ||
535 | |||
536 | IDxDiagProvider *dx_diag_providerp = NULL; | ||
537 | IDxDiagContainer *dx_diag_rootp = NULL; | ||
538 | IDxDiagContainer *devices_containerp = NULL; | ||
539 | IDxDiagContainer *device_containerp = NULL; | ||
540 | IDxDiagContainer *file_containerp = NULL; | ||
541 | IDxDiagContainer *driver_containerp = NULL; | ||
542 | |||
543 | // CoCreate a IDxDiagProvider* | ||
544 | llinfos << "CoCreateInstance IID_IDxDiagProvider" << llendl; | ||
545 | hr = CoCreateInstance(CLSID_DxDiagProvider, | ||
546 | NULL, | ||
547 | CLSCTX_INPROC_SERVER, | ||
548 | IID_IDxDiagProvider, | ||
549 | (LPVOID*) &dx_diag_providerp); | ||
550 | |||
551 | if (FAILED(hr)) | ||
552 | { | ||
553 | llwarns << "No DXDiag provider found! DirectX 9 not installed!" << llendl; | ||
554 | gWriteDebug("No DXDiag provider found! DirectX 9 not installed!\n"); | ||
555 | goto LCleanup; | ||
556 | } | ||
557 | if (SUCCEEDED(hr)) // if FAILED(hr) then dx9 is not installed | ||
558 | { | ||
559 | // Fill out a DXDIAG_INIT_PARAMS struct and pass it to IDxDiagContainer::Initialize | ||
560 | // Passing in TRUE for bAllowWHQLChecks, allows dxdiag to check if drivers are | ||
561 | // digital signed as logo'd by WHQL which may connect via internet to update | ||
562 | // WHQL certificates. | ||
563 | DXDIAG_INIT_PARAMS dx_diag_init_params; | ||
564 | ZeroMemory(&dx_diag_init_params, sizeof(DXDIAG_INIT_PARAMS)); | ||
565 | |||
566 | dx_diag_init_params.dwSize = sizeof(DXDIAG_INIT_PARAMS); | ||
567 | dx_diag_init_params.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION; | ||
568 | dx_diag_init_params.bAllowWHQLChecks = TRUE; | ||
569 | dx_diag_init_params.pReserved = NULL; | ||
570 | |||
571 | llinfos << "dx_diag_providerp->Initialize" << llendl; | ||
572 | hr = dx_diag_providerp->Initialize(&dx_diag_init_params); | ||
573 | if(FAILED(hr)) | ||
574 | { | ||
575 | goto LCleanup; | ||
576 | } | ||
577 | |||
578 | llinfos << "dx_diag_providerp->GetRootContainer" << llendl; | ||
579 | hr = dx_diag_providerp->GetRootContainer( &dx_diag_rootp ); | ||
580 | if(FAILED(hr) || !dx_diag_rootp) | ||
581 | { | ||
582 | goto LCleanup; | ||
583 | } | ||
584 | |||
585 | HRESULT hr; | ||
586 | |||
587 | // Get display driver information | ||
588 | llinfos << "dx_diag_rootp->GetChildContainer" << llendl; | ||
589 | hr = dx_diag_rootp->GetChildContainer(L"DxDiag_DisplayDevices", &devices_containerp); | ||
590 | if(FAILED(hr) || !devices_containerp) | ||
591 | { | ||
592 | goto LCleanup; | ||
593 | } | ||
594 | |||
595 | // Get device 0 | ||
596 | llinfos << "devices_containerp->GetChildContainer" << llendl; | ||
597 | hr = devices_containerp->GetChildContainer(L"0", &device_containerp); | ||
598 | if(FAILED(hr) || !device_containerp) | ||
599 | { | ||
600 | goto LCleanup; | ||
601 | } | ||
602 | |||
603 | // Get the English VRAM string | ||
604 | std::string ram_str = get_string(device_containerp, L"szDisplayMemoryEnglish"); | ||
605 | |||
606 | |||
607 | // Dump the string as an int into the structure | ||
608 | char *stopstring; | ||
609 | ret["VRAM"] = strtol(ram_str.c_str(), &stopstring, 10); | ||
610 | std::string device_name = get_string(device_containerp, L"szDescription"); | ||
611 | ret["DeviceName"] = device_name; | ||
612 | std::string device_driver= get_string(device_containerp, L"szDriverVersion"); | ||
613 | ret["DriverVersion"] = device_driver; | ||
614 | } | ||
615 | LCleanup: | ||
616 | SAFE_RELEASE(file_containerp); | ||
617 | SAFE_RELEASE(driver_containerp); | ||
618 | SAFE_RELEASE(device_containerp); | ||
619 | SAFE_RELEASE(devices_containerp); | ||
620 | SAFE_RELEASE(dx_diag_rootp); | ||
621 | SAFE_RELEASE(dx_diag_providerp); | ||
622 | |||
623 | CoUninitialize(); | ||
624 | return ret; | ||
625 | } | ||
626 | |||
525 | void LLDXHardware::setWriteDebugFunc(void (*func)(const char*)) | 627 | void LLDXHardware::setWriteDebugFunc(void (*func)(const char*)) |
526 | { | 628 | { |
527 | gWriteDebug = func; | 629 | gWriteDebug = func; |
diff --git a/linden/indra/llwindow/lldxhardware.h b/linden/indra/llwindow/lldxhardware.h index 1d5d69d..e2a255d 100644 --- a/linden/indra/llwindow/lldxhardware.h +++ b/linden/indra/llwindow/lldxhardware.h | |||
@@ -36,6 +36,7 @@ | |||
36 | 36 | ||
37 | #include "stdtypes.h" | 37 | #include "stdtypes.h" |
38 | #include "llstring.h" | 38 | #include "llstring.h" |
39 | #include "llsd.h" | ||
39 | 40 | ||
40 | class LLVersion | 41 | class LLVersion |
41 | { | 42 | { |
@@ -93,6 +94,8 @@ public: | |||
93 | 94 | ||
94 | S32 getVRAM() const { return mVRAM; } | 95 | S32 getVRAM() const { return mVRAM; } |
95 | 96 | ||
97 | LLSD getDisplayInfo(); | ||
98 | |||
96 | // Find a particular device that matches the following specs. | 99 | // Find a particular device that matches the following specs. |
97 | // Empty strings indicate that you don't care. | 100 | // Empty strings indicate that you don't care. |
98 | // You can separate multiple devices with '|' chars to indicate you want | 101 | // You can separate multiple devices with '|' chars to indicate you want |
diff --git a/linden/indra/llwindow/llgl.cpp b/linden/indra/llwindow/llgl.cpp index 35f20d3..df87591 100644 --- a/linden/indra/llwindow/llgl.cpp +++ b/linden/indra/llwindow/llgl.cpp | |||
@@ -36,6 +36,8 @@ | |||
36 | 36 | ||
37 | #include "linden_common.h" | 37 | #include "linden_common.h" |
38 | 38 | ||
39 | #include "boost/tokenizer.hpp" | ||
40 | |||
39 | #include "llsys.h" | 41 | #include "llsys.h" |
40 | 42 | ||
41 | #include "llgl.h" | 43 | #include "llgl.h" |
@@ -459,6 +461,23 @@ bool LLGLManager::initGL() | |||
459 | return true; | 461 | return true; |
460 | } | 462 | } |
461 | 463 | ||
464 | void LLGLManager::getGLInfo(LLSD& info) | ||
465 | { | ||
466 | info["GLInfo"]["GLVendor"] = LLString((const char *)glGetString(GL_VENDOR)); | ||
467 | info["GLInfo"]["GLRenderer"] = LLString((const char *)glGetString(GL_RENDERER)); | ||
468 | info["GLInfo"]["GLVersion"] = LLString((const char *)glGetString(GL_VERSION)); | ||
469 | |||
470 | #if !LL_MESA_HEADLESS | ||
471 | LLString all_exts = (const char *)gGLHExts.mSysExts; | ||
472 | boost::char_separator<char> sep(" "); | ||
473 | boost::tokenizer<boost::char_separator<char> > tok(all_exts, sep); | ||
474 | for(boost::tokenizer<boost::char_separator<char> >::iterator i = tok.begin(); i != tok.end(); ++i) | ||
475 | { | ||
476 | info["GLInfo"]["GLExtensions"].append(*i); | ||
477 | } | ||
478 | #endif | ||
479 | } | ||
480 | |||
462 | LLString LLGLManager::getGLInfoString() | 481 | LLString LLGLManager::getGLInfoString() |
463 | { | 482 | { |
464 | LLString info_str; | 483 | LLString info_str; |
diff --git a/linden/indra/llwindow/llgl.h b/linden/indra/llwindow/llgl.h index 2a23a23..a8e14b7 100644 --- a/linden/indra/llwindow/llgl.h +++ b/linden/indra/llwindow/llgl.h | |||
@@ -48,6 +48,8 @@ | |||
48 | 48 | ||
49 | #define LL_GL_ERRS llerrs | 49 | #define LL_GL_ERRS llerrs |
50 | 50 | ||
51 | class LLSD; | ||
52 | |||
51 | // Manage GL extensions... | 53 | // Manage GL extensions... |
52 | class LLGLManager | 54 | class LLGLManager |
53 | { | 55 | { |
@@ -122,6 +124,7 @@ public: | |||
122 | void getPixelFormat(); // Get the best pixel format | 124 | void getPixelFormat(); // Get the best pixel format |
123 | 125 | ||
124 | LLString getGLInfoString(); | 126 | LLString getGLInfoString(); |
127 | void getGLInfo(LLSD& info); | ||
125 | 128 | ||
126 | // In ALL CAPS | 129 | // In ALL CAPS |
127 | LLString mGLVendor; | 130 | LLString mGLVendor; |
diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index c84611b..1fa50de 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp | |||
@@ -93,6 +93,7 @@ BOOL LLWindowWin32::sWinIMEOpened = FALSE; | |||
93 | HKL LLWindowWin32::sWinInputLocale = 0; | 93 | HKL LLWindowWin32::sWinInputLocale = 0; |
94 | DWORD LLWindowWin32::sWinIMEConversionMode = IME_CMODE_NATIVE; | 94 | DWORD LLWindowWin32::sWinIMEConversionMode = IME_CMODE_NATIVE; |
95 | DWORD LLWindowWin32::sWinIMESentenceMode = IME_SMODE_AUTOMATIC; | 95 | DWORD LLWindowWin32::sWinIMESentenceMode = IME_SMODE_AUTOMATIC; |
96 | LLCoordWindow LLWindowWin32::sWinIMEWindowPosition(-1,-1); | ||
96 | 97 | ||
97 | // The following class LLWinImm delegates Windows IMM APIs. | 98 | // The following class LLWinImm delegates Windows IMM APIs. |
98 | // We need this because some language versions of Windows, | 99 | // We need this because some language versions of Windows, |
@@ -3381,7 +3382,8 @@ void LLWindowWin32::setLanguageTextInput( const LLCoordGL & position ) | |||
3381 | LLCoordWindow win_pos; | 3382 | LLCoordWindow win_pos; |
3382 | convertCoords( position, &win_pos ); | 3383 | convertCoords( position, &win_pos ); |
3383 | 3384 | ||
3384 | if ( win_pos.mX >= 0 && win_pos.mY >= 0 ) | 3385 | if ( win_pos.mX >= 0 && win_pos.mY >= 0 && |
3386 | (win_pos.mX != sWinIMEWindowPosition.mX) || (win_pos.mY != sWinIMEWindowPosition.mY) ) | ||
3385 | { | 3387 | { |
3386 | COMPOSITIONFORM ime_form; | 3388 | COMPOSITIONFORM ime_form; |
3387 | memset( &ime_form, 0, sizeof(ime_form) ); | 3389 | memset( &ime_form, 0, sizeof(ime_form) ); |
@@ -3390,10 +3392,11 @@ void LLWindowWin32::setLanguageTextInput( const LLCoordGL & position ) | |||
3390 | ime_form.ptCurrentPos.y = win_pos.mY; | 3392 | ime_form.ptCurrentPos.y = win_pos.mY; |
3391 | 3393 | ||
3392 | LLWinImm::setCompositionWindow( himc, &ime_form ); | 3394 | LLWinImm::setCompositionWindow( himc, &ime_form ); |
3395 | |||
3396 | sWinIMEWindowPosition.set( win_pos.mX, win_pos.mY ); | ||
3393 | } | 3397 | } |
3394 | 3398 | ||
3395 | LLWinImm::releaseContext(mWindowHandle, himc); | 3399 | LLWinImm::releaseContext(mWindowHandle, himc); |
3396 | |||
3397 | } | 3400 | } |
3398 | } | 3401 | } |
3399 | 3402 | ||
diff --git a/linden/indra/llwindow/llwindowwin32.h b/linden/indra/llwindow/llwindowwin32.h index f1e977e..602e066 100644 --- a/linden/indra/llwindow/llwindowwin32.h +++ b/linden/indra/llwindow/llwindowwin32.h | |||
@@ -188,6 +188,7 @@ protected: | |||
188 | static HKL sWinInputLocale; | 188 | static HKL sWinInputLocale; |
189 | static DWORD sWinIMEConversionMode; | 189 | static DWORD sWinIMEConversionMode; |
190 | static DWORD sWinIMESentenceMode; | 190 | static DWORD sWinIMESentenceMode; |
191 | static LLCoordWindow sWinIMEWindowPosition; | ||
191 | 192 | ||
192 | friend class LLWindowManager; | 193 | friend class LLWindowManager; |
193 | }; | 194 | }; |