Reverted use of tchar.h which should be considered deprecated.

GZDoom is Unicode only - as should be the norm for any Windows application - and will not work when compiled as ANSI so there's no good reason to use this wrapper.
This commit is contained in:
Christoph Oelckers 2024-08-16 12:36:42 +02:00
parent f5c86819ab
commit 5fa220219e
3 changed files with 6 additions and 15 deletions

View file

@ -1,7 +1,6 @@
#include "win32window.h"
#include <windowsx.h>
#include <tchar.h>
#include <stdexcept>
#include <cmath>
#include <vector>
@ -82,11 +81,11 @@ Win32Window::Win32Window(DisplayWindowHost* windowHost) : WindowHost(windowHost)
Windows.push_front(this);
WindowsIterator = Windows.begin();
WNDCLASSEX classdesc = {};
WNDCLASSEXW classdesc = {};
classdesc.cbSize = sizeof(WNDCLASSEX);
classdesc.hInstance = GetModuleHandle(0);
classdesc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
classdesc.lpszClassName = _T( "ZWidgetWindow" );
classdesc.lpszClassName = L"ZWidgetWindow";
classdesc.lpfnWndProc = &Win32Window::WndProc;
RegisterClassEx(&classdesc);
@ -95,7 +94,7 @@ Win32Window::Win32Window(DisplayWindowHost* windowHost) : WindowHost(windowHost)
// WS_CAPTION shows the caption (yay! actually a flag that does what it says it does!)
// WS_SYSMENU shows the min/max/close buttons
// WS_THICKFRAME makes the window resizable
CreateWindowEx(WS_EX_APPWINDOW | WS_EX_DLGMODALFRAME, _T( "ZWidgetWindow" ), _T( "" ), WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, 0, 0, 100, 100, 0, 0, GetModuleHandle(0), this);
CreateWindowExW(WS_EX_APPWINDOW | WS_EX_DLGMODALFRAME, L"ZWidgetWindow", L"", WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, 0, 0, 100, 100, 0, 0, GetModuleHandle(0), this);
/*
RAWINPUTDEVICE rid;
@ -299,7 +298,7 @@ double Win32Window::GetDpiScale() const
static bool done = false;
if (!done)
{
HMODULE hMod = GetModuleHandle( _T( "User32.dll" ));
HMODULE hMod = GetModuleHandleA("User32.dll");
if (hMod != nullptr) pGetDpiForWindow = reinterpret_cast<GetDpiForWindow_t>(GetProcAddress(hMod, "GetDpiForWindow"));
done = true;
}

View file

@ -69,20 +69,13 @@ if( WIN32 )
setupapi
oleaut32
dbghelp
dxguid
dwmapi
)
if( NOT MINGW )
list( APPEND PROJECT_LIBRARIES legacy_stdio_definitions )
endif()
legacy_stdio_definitions )
if( DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
if( DX_dxguid_LIBRARY )
list( APPEND PROJECT_LIBRARIES "${DX_dxguid_LIBRARY}" )
endif()
endif()
else()
if( APPLE )
set( NO_GTK ON )

View file

@ -46,7 +46,6 @@ static void* PosixGetProcAddress (const GLubyte* name)
#undef APIENTRY
#endif
#include <windows.h>
#include <tchar.h>
#ifdef _MSC_VER
@ -77,7 +76,7 @@ static void CheckOpenGL(void)
{
if (opengl32dll == 0)
{
opengl32dll = LoadLibrary(_T("OpenGL32.DLL"));
opengl32dll = LoadLibraryA("OpenGL32.DLL");
if (opengl32dll != 0)
{
createcontext = (HGLRC(WINAPI*)(HDC)) GetProcAddress(opengl32dll, "wglCreateContext");