Skip to content

Commit

Permalink
Small fixes for Windows compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Mar 12, 2020
1 parent 8ab9b9a commit b3e0d9c
Show file tree
Hide file tree
Showing 5 changed files with 5,199 additions and 10 deletions.
3 changes: 1 addition & 2 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,5 @@ target_link_libraries(${PROJECT_NAME}
sfml-system
sfml-network
${UNIX_LIBS}
${CMAKE_PROJECT_NAME}_common
stdc++fs)
${CMAKE_PROJECT_NAME}_common)

8 changes: 4 additions & 4 deletions client/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ typedef enum PROCESS_DPI_AWARENESS {
} PROCESS_DPI_AWARENESS;

void setDpiAwareness() {
BOOL(WINAPI *SetProcessDPIAware)(void); // Vista and later
HRESULT(WINAPI *SetProcessDpiAwareness)(PROCESS_DPI_AWARENESS dpiAwareness); // Windows 8.1 and later
BOOL(WINAPI *SetProcessDPIAware)(void) = nullptr; // Vista and later
HRESULT(WINAPI *SetProcessDpiAwareness)(PROCESS_DPI_AWARENESS dpiAwareness) = nullptr; // Windows 8.1 and later

void *userDLL = SDL_LoadObject("USER32.DLL");
if (userDLL) {
Expand All @@ -66,12 +66,12 @@ void setDpiAwareness() {

if (SetProcessDpiAwareness) {
// Try Windows 8.1+ version
HRESULT result = SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
/*HRESULT result = */SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
}
else if (SetProcessDPIAware) {
// Try Vista - Windows 8 version.
// This has a constant scale factor for all monitors.
BOOL success = SetProcessDPIAware();
/*BOOL success = */SetProcessDPIAware();
}
}
#endif
Expand Down
Loading

0 comments on commit b3e0d9c

Please sign in to comment.