Skip to content

Commit

Permalink
Tell Windows that we are DPI aware so that it stops trying to scale t…
Browse files Browse the repository at this point in the history
…he resolution values.
  • Loading branch information
blast007 committed Oct 12, 2015
1 parent b77971a commit efff5cb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/bzflag/bzflag.cxx
Expand Up @@ -30,6 +30,9 @@
# include <sys/types.h>
# include <sys/stat.h>
# include <direct.h>
# if !defined(HAVE_SDL)
# include <tchar.h>
# endif /* !defined(HAVE_SDL) */
#else
# include <pwd.h>
# include <dirent.h>
Expand Down Expand Up @@ -1413,6 +1416,14 @@ int main(int argc, char** argv)

int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR _cmdLine, int)
{
// Tell Windows that we are DPI aware so that it stop trying to scale for us
HMODULE hUser32 = LoadLibrary(_T("user32.dll"));
typedef BOOL (*SetProcessDPIAwareFunc)();
SetProcessDPIAwareFunc setDPIAware = (SetProcessDPIAwareFunc)GetProcAddress(hUser32, "SetProcessDPIAware");
if (setDPIAware)
setDPIAware();
FreeLibrary(hUser32);

// convert command line to argc and argv. note that it's too late
// to do this right because spaces that were embedded in a single
// argument now look like like normal spaces. not much we can do
Expand Down

0 comments on commit efff5cb

Please sign in to comment.