1
0
Fork 0

Disable scaling by the OS on windows (scale != 100%). Could not get this working through the manifest, but this seems to work as well.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4303
This commit is contained in:
Peter Veenstra 2020-01-05 16:48:41 +00:00
parent 19b9bde38a
commit c5ad973795

View file

@ -99,6 +99,7 @@ extern char** environ;
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <winuser.h>
#if C_DDRAW
#include <ddraw.h>
struct private_hwdata {
@ -1978,10 +1979,22 @@ static void erasemapperfile() {
exit(0);
}
void Disable_OS_Scaling() {
#if defined (WIN32)
typedef BOOL (*function_set_dpi_pointer)();
function_set_dpi_pointer function_set_dpi;
function_set_dpi = (function_set_dpi_pointer) GetProcAddress(LoadLibrary("user32.dll"), "SetProcessDPIAware");
if (function_set_dpi) {
function_set_dpi();
}
#endif
}
//extern void UI_Init(void);
int main(int argc, char* argv[]) {
try {
Disable_OS_Scaling(); //Do this early on, maybe override it through some parameter.
CommandLine com_line(argc,argv);
Config myconf(&com_line);
control=&myconf;