使用 SDL 创建 window 时,VS 解决方案配置会影响 window 分辨率

VS solution configuration affects window resolution when creating window with SDL

我的应用程序以不同的分辨率启动,具体取决于我是在调试还是发布配置中构建它。这种行为是不需要的和意外的。

Window 是这样创建的:

screen->window = SDL_CreateWindow(WINDOW_TITLE, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, screen->width, screen->height, SDL_WINDOW_SHOWN);

screen-width 和 screen-height 定义在 header.

#define SCREEN_WIDTH 1024
#define SCREEN_HEIGHT 800

当我运行它用DEBUG配置时,它似乎运行处于桌面显示模式(1080p)。在发行版中,运行s 好像桌面是 1024x800。

问题是应用程序在应用程序属性中启用了 "Disable display scaling on high DPI settings" 选项。当我禁用它时,问题就消失了。