summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowwin32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r--indra/llwindow/llwindowwin32.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 03cc10e5d6..cfc2038be9 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -812,7 +812,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
// }
// SL-12971 dual GPU display
- DISPLAY_DEVICEA display_device;
+ DISPLAY_DEVICE display_device;
int display_index = -1;
DWORD display_flags = 0; // EDD_GET_DEVICE_INTERFACE_NAME ?
const size_t display_bytes = sizeof(display_device);
@@ -823,23 +823,23 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
{
// CHAR DeviceName [ 32] Adapter name
// CHAR DeviceString[128]
- CHAR text[256];
+ WCHAR text[256];
- size_t name_len = strlen(display_device.DeviceName );
- size_t desc_len = strlen(display_device.DeviceString);
+ size_t name_len = lstrlen(display_device.DeviceName );
+ size_t desc_len = lstrlen(display_device.DeviceString);
- const CHAR *name = name_len ? display_device.DeviceName : "???";
- const CHAR *desc = desc_len ? display_device.DeviceString : "???";
+ const WCHAR *name = name_len ? display_device.DeviceName : TEXT("???");
+ const WCHAR *desc = desc_len ? display_device.DeviceString : TEXT("???");
- sprintf(text, "Display Device %d: %s, %s", display_index, name, desc);
- LL_INFOS("Window") << text << LL_ENDL;
+ wsprintf(text, TEXT("Display Device %d: %s, %s"), display_index, name, desc);
+ LL_INFOS("Window") << ll_convert<std::string>(std::wstring(text)) << LL_ENDL;
}
::ZeroMemory(&display_device,display_bytes);
display_device.cb = display_bytes;
display_index++;
- } while( EnumDisplayDevicesA(NULL, display_index, &display_device, display_flags ));
+ } while( EnumDisplayDevices(NULL, display_index, &display_device, display_flags ));
LL_INFOS("Window") << "Total Display Devices: " << display_index << LL_ENDL;
@@ -1698,6 +1698,11 @@ const S32 max_format = (S32)num_formats - 1;
return false;
}
+ // Setup Tracy gpu context
+ {
+ LL_PROFILER_GPU_CONTEXT;
+ }
+
// Disable vertical sync for swap
toggleVSync(enable_vsync);
@@ -1729,8 +1734,6 @@ const S32 max_format = (S32)num_formats - 1;
swapBuffers();
}
- LL_PROFILER_GPU_CONTEXT;
-
return true;
}
@@ -1963,7 +1966,7 @@ void LLWindowWin32::setTitle(const std::string title)
// to support non-ascii usernames (and region names?)
mWindowThread->post([=]()
{
- SetWindowTextA(mWindowHandle, title.c_str());
+ SetWindowText(mWindowHandle, ll_convert<std::wstring>(title).c_str());
});
}
@@ -3288,7 +3291,7 @@ bool LLWindowWin32::pasteTextFromClipboard(LLWString &dst)
WCHAR *utf16str = (WCHAR*) GlobalLock(h_data);
if (utf16str)
{
- dst = utf16str_to_wstring(utf16str);
+ dst = ll_convert<LLWString>(std::wstring(utf16str));
LLWStringUtil::removeWindowsCR(dst);
GlobalUnlock(h_data);
success = true;
@@ -3313,8 +3316,8 @@ bool LLWindowWin32::copyTextToClipboard(const LLWString& wstr)
// Provide a copy of the data in Unicode format.
LLWString sanitized_string(wstr);
LLWStringUtil::addCRLF(sanitized_string);
- llutf16string out_utf16 = wstring_to_utf16str(sanitized_string);
- const size_t size_utf16 = (out_utf16.length() + 1) * sizeof(WCHAR);
+ std::wstring out_utf16 = ll_convert<std::wstring>(sanitized_string);
+ const size_t size_utf16 = (out_utf16.length() + 1) * sizeof(wchar_t);
// Memory is allocated and then ownership of it is transfered to the system.
HGLOBAL hglobal_copy_utf16 = GlobalAlloc(GMEM_MOVEABLE, size_utf16);
@@ -3674,7 +3677,7 @@ void LLSplashScreenWin32::showImpl()
ShowWindow(mWindow, SW_SHOW);
// Should set taskbar text without creating a header for the window (caption)
- SetWindowTextA(mWindow, "Second Life");
+ SetWindowText(mWindow, TEXT("Second Life"));
}
@@ -3811,8 +3814,7 @@ void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url, bool async)
// reliablly on Vista.
// this is madness.. no, this is..
- LLWString url_wstring = utf8str_to_wstring( escaped_url );
- llutf16string url_utf16 = wstring_to_utf16str( url_wstring );
+ std::wstring url_utf16 = ll_convert<std::wstring>(escaped_url);
// let the OS decide what to use to open the URL
SHELLEXECUTEINFO sei = { sizeof( sei ) };
@@ -4100,7 +4102,7 @@ void LLWindowWin32::fillCompositionLogfont(LOGFONT *logfont)
U32 LLWindowWin32::fillReconvertString(const LLWString &text,
S32 focus, S32 focus_length, RECONVERTSTRING *reconvert_string)
{
- const llutf16string text_utf16 = wstring_to_utf16str(text);
+ const std::wstring text_utf16 = ll_convert<std::wstring>(text);
const DWORD required_size = sizeof(RECONVERTSTRING) + (static_cast<DWORD>(text_utf16.length()) + 1) * sizeof(WCHAR);
if (reconvert_string && reconvert_string->dwSize >= required_size)
{
@@ -4200,7 +4202,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes)
size = LLWinImm::getCompositionString(himc, GCS_RESULTSTR, data, size);
if (size > 0)
{
- result_string = utf16str_to_wstring(llutf16string(data, size / sizeof(WCHAR)));
+ result_string = ll_convert_wide_to_wstring(std::wstring(data, size / sizeof(WCHAR)));
}
delete[] data;
needs_update = true;
@@ -4217,7 +4219,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes)
if (size > 0)
{
preedit_string_utf16_length = size / sizeof(WCHAR);
- preedit_string = utf16str_to_wstring(llutf16string(data, size / sizeof(WCHAR)));
+ preedit_string = ll_convert_wide_to_wstring(std::wstring(data, size / sizeof(WCHAR)));
}
delete[] data;
needs_update = true;