]> git.lizzy.rs Git - irrlicht.git/commitdiff
win32: use the unicode window instead of ansi window (#138)
authorRiceball LEE <snowyu.lee@gmail.com>
Fri, 14 Oct 2022 13:52:10 +0000 (21:52 +0800)
committerGitHub <noreply@github.com>
Fri, 14 Oct 2022 13:52:10 +0000 (15:52 +0200)
source/Irrlicht/CIrrDeviceWin32.cpp

index d8d1702a9e19a0bf812cde83ad4d1f41e8998128..f5508078bb1b33000655c99564482819f721e5e4 100644 (file)
@@ -720,7 +720,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                                dev->postEventFromUser(event);\r
 \r
                        if (message == WM_SYSKEYDOWN || message == WM_SYSKEYUP)\r
-                               return DefWindowProc(hWnd, message, wParam, lParam);\r
+                               return DefWindowProcW(hWnd, message, wParam, lParam);\r
                        else\r
                                return 0;\r
                }\r
@@ -774,7 +774,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                KEYBOARD_INPUT_HKL = GetKeyboardLayout(0);\r
                return 0;\r
        }\r
-       return DefWindowProc(hWnd, message, wParam, lParam);\r
+       return DefWindowProcW(hWnd, message, wParam, lParam);\r
 }\r
 \r
 \r
@@ -802,11 +802,11 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
        // create the window if we need to and we do not use the null device\r
        if (!CreationParams.WindowId && CreationParams.DriverType != video::EDT_NULL)\r
        {\r
-               const fschar_t* ClassName = __TEXT("CIrrDeviceWin32");\r
+               const wchar_t* ClassName = L"CIrrDeviceWin32";\r
 \r
                // Register Class\r
-               WNDCLASSEX wcex;\r
-               wcex.cbSize                     = sizeof(WNDCLASSEX);\r
+               WNDCLASSEXW wcex;\r
+               wcex.cbSize                     = sizeof(WNDCLASSEXW);\r
                wcex.style                      = CS_HREDRAW | CS_VREDRAW;\r
                wcex.lpfnWndProc        = WndProc;\r
                wcex.cbClsExtra         = 0;\r
@@ -820,9 +820,9 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
                wcex.hIconSm            = 0;\r
 \r
                // if there is an icon, load it\r
-               wcex.hIcon = (HICON)LoadImage(hInstance, __TEXT("irrlicht.ico"), IMAGE_ICON, 0,0, LR_LOADFROMFILE | LR_DEFAULTSIZE);\r
+               wcex.hIcon = (HICON)LoadImageW(hInstance, L"irrlicht.ico", IMAGE_ICON, 0,0, LR_LOADFROMFILE | LR_DEFAULTSIZE);\r
 \r
-               RegisterClassEx(&wcex);\r
+               RegisterClassExW(&wcex);\r
 \r
                // calculate client size\r
 \r
@@ -857,7 +857,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
                }\r
 \r
                // create window\r
-               HWnd = CreateWindow( ClassName, __TEXT(""), style, windowLeft, windowTop,\r
+               HWnd = CreateWindowW( ClassName, L"", style, windowLeft, windowTop,\r
                                        realWidth, realHeight, NULL, NULL, hInstance, NULL);\r
                if (!HWnd)\r
                {\r
@@ -1185,9 +1185,9 @@ void CIrrDeviceWin32::closeDevice()
                PostQuitMessage(0);\r
                PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE);\r
                DestroyWindow(HWnd);\r
-               const fschar_t* ClassName = __TEXT("CIrrDeviceWin32");\r
+               const wchar_t* ClassName = L"CIrrDeviceWin32";\r
                HINSTANCE hInstance = GetModuleHandle(0);\r
-               UnregisterClass(ClassName, hInstance);\r
+               UnregisterClassW(ClassName, hInstance);\r
        }\r
        Close=true;\r
 }\r