Browse Source

[rcore][win32] fixes from review/for gcc

pull/4869/head
Jonathan Marler 3 months ago
parent
commit
df5a3cee4a
2 changed files with 8 additions and 22 deletions
  1. +7
    -0
      src/Makefile
  2. +1
    -22
      src/platforms/rcore_desktop_win32.c

+ 7
- 0
src/Makefile View File

@ -342,6 +342,10 @@ ifeq ($(PLATFORM_OS), LINUX)
CFLAGS += -fPIC
endif
ifeq ($(PLATFORM_OS),WINDOWS)
CFLAGS += -DUNICODE
endif
ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
CFLAGS += -g -D_DEBUG
endif
@ -628,6 +632,9 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
LDLIBS += -latomic
endif
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32)
LDLIBS = -lgdi32 -lwinmm -lopengl32 -lshcore
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lc -lm
endif

+ 1
- 22
src/platforms/rcore_desktop_win32.c View File

@ -129,7 +129,6 @@ static bool ResizableFromStyle(DWORD style)
}
static bool DecoratedFromStyle(DWORD style)
{
bool is_off;
if (style & STYLE_FLAGS_UNDECORATED_ON) {
if (style & STYLE_FLAGS_UNDECORATED_OFF) {
TRACELOG(LOG_ERROR, "style 0x%x has both undecorated on/off flags", style);
@ -471,7 +470,7 @@ static BOOL IsWindows10Version1703OrGreaterWin32(void)
LogFail("GetProcAddress 'RtlVerifyVersionInfo'", GetLastError());
return 0;
}
OSVERSIONINFOEX osvi = { 0 };
RTL_OSVERSIONINFOEXW osvi = { 0 };
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
osvi.dwMajorVersion = 10;
osvi.dwMinorVersion = 0;
@ -713,26 +712,6 @@ static LPCWSTR GetCursorName(int cursor)
}
static UINT GetMonitorDpi(HMONITOR monitor)
{
UINT dpi_x;
UINT dpi_y;
HRESULT hr = GetDpiForMonitor(monitor, MDT_EFFECTIVE_DPI, &dpi_x, &dpi_y);
if (hr < 0) {
LogFailHr("GetDpiForMonitor", hr);
abort();
}
if (dpi_x != dpi_y) {
TRACELOG(LOG_ERROR, "DPI X (%lu) != DPI Y (%lu)", dpi_x, dpi_y);
abort();
}
if (dpi_x < 96) {
TRACELOG(LOG_ERROR, "unexpected dpi %lu", dpi_x);
abort();
}
return dpi_x;
}
static BOOL CALLBACK CountMonitorsProc(HMONITOR handle, HDC _, LPRECT rect, LPARAM lparam)
{
int* count = (int*)lparam;

Loading…
Cancel
Save