From 83e6cfbec057e932c8311b06c2769f5cf91382ed Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 22 Nov 2015 21:23:56 +0000 Subject: [PATCH] Examples: DirectX9/11: Removed assumption about Unicode build in example main.cpp (#399) --- examples/directx11_example/main.cpp | 9 +++++---- examples/directx9_example/main.cpp | 11 ++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/examples/directx11_example/main.cpp b/examples/directx11_example/main.cpp index 13e60a6c1..5341121f9 100644 --- a/examples/directx11_example/main.cpp +++ b/examples/directx11_example/main.cpp @@ -6,6 +6,7 @@ #include #define DIRECTINPUT_VERSION 0x0800 #include +#include // Data static ID3D11Device* g_pd3dDevice = NULL; @@ -131,15 +132,15 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) int main(int, char**) { // Create application window - WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, LoadCursor(NULL, IDC_ARROW), NULL, NULL, L"ImGui Example", NULL }; + WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, LoadCursor(NULL, IDC_ARROW), NULL, NULL, _T("ImGui Example"), NULL }; RegisterClassEx(&wc); - HWND hwnd = CreateWindow(L"ImGui Example", L"ImGui DirectX11 Example", WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, NULL, NULL, wc.hInstance, NULL); + HWND hwnd = CreateWindow(_T("ImGui Example"), _T("ImGui DirectX11 Example"), WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, NULL, NULL, wc.hInstance, NULL); // Initialize Direct3D if (CreateDeviceD3D(hwnd) < 0) { CleanupDeviceD3D(); - UnregisterClass(L"ImGui Example", wc.hInstance); + UnregisterClass(_T("ImGui Example"), wc.hInstance); return 1; } @@ -219,7 +220,7 @@ int main(int, char**) ImGui_ImplDX11_Shutdown(); CleanupDeviceD3D(); - UnregisterClass(L"ImGui Example", wc.hInstance); + UnregisterClass(_T("ImGui Example"), wc.hInstance); return 0; } diff --git a/examples/directx9_example/main.cpp b/examples/directx9_example/main.cpp index 2143b8711..9c49a26f2 100644 --- a/examples/directx9_example/main.cpp +++ b/examples/directx9_example/main.cpp @@ -5,6 +5,7 @@ #include #define DIRECTINPUT_VERSION 0x0800 #include +#include // Data static LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; @@ -44,15 +45,15 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) int main(int, char**) { // Create application window - WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, LoadCursor(NULL, IDC_ARROW), NULL, NULL, L"ImGui Example", NULL }; + WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, LoadCursor(NULL, IDC_ARROW), NULL, NULL, _T("ImGui Example"), NULL }; RegisterClassEx(&wc); - HWND hwnd = CreateWindow(L"ImGui Example", L"ImGui DirectX9 Example", WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, NULL, NULL, wc.hInstance, NULL); + HWND hwnd = CreateWindow(_T("ImGui Example"), _T("ImGui DirectX9 Example"), WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, NULL, NULL, wc.hInstance, NULL); // Initialize Direct3D LPDIRECT3D9 pD3D; if ((pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL) { - UnregisterClass(L"ImGui Example", wc.hInstance); + UnregisterClass(_T("ImGui Example"), wc.hInstance); return 0; } ZeroMemory(&g_d3dpp, sizeof(g_d3dpp)); @@ -67,7 +68,7 @@ int main(int, char**) if (pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &g_d3dpp, &g_pd3dDevice) < 0) { pD3D->Release(); - UnregisterClass(L"ImGui Example", wc.hInstance); + UnregisterClass(_T("ImGui Example"), wc.hInstance); return 0; } @@ -154,7 +155,7 @@ int main(int, char**) ImGui_ImplDX9_Shutdown(); if (g_pd3dDevice) g_pd3dDevice->Release(); if (pD3D) pD3D->Release(); - UnregisterClass(L"ImGui Example", wc.hInstance); + UnregisterClass(_T("ImGui Example"), wc.hInstance); return 0; }