Get screen resolution in Windows

This commit is contained in:
Linus Probert 2017-12-20 19:17:41 +01:00
parent d4fa9f89d6
commit 9250dad9ce
1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,8 @@
#ifndef _WIN32 #ifndef _WIN32
#include <X11/Xlib.h> #include <X11/Xlib.h>
#else // _WIN32
#include <windows.h>
#endif // _WIN32 #endif // _WIN32
#include <stdlib.h> #include <stdlib.h>
@ -17,7 +19,7 @@ Dimension getScreenDimensions(void)
free(d); free(d);
free(s); free(s);
#else // _WIN32 #else // _WIN32
Dimension dim = (Dimension) { 1920, 1080 }; Dimension dim = (Dimension) { GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN) };
#endif // _WIN32 #endif // _WIN32
return dim; return dim;