区分代码中的平移和普通屏幕模式 - Windows

时间:2010-07-23 08:52:22

标签: c++ windows screen-resolution panning resolution-independence

我正在编写一个全屏3D游戏,我创建了一个菜单,用户可以选择屏幕分辨率以匹配他的硬件容量。

我正在使用EnumDisplaySettingsExA列举所有可用的屏幕模式,如下所示:

std::vector<DEVMODEA> modes;
DEVMODEA modeInfo;
int modeNum = -1;
while (EnumDisplaySettingsExA(0, ++modeNum, &modeInfo, 0)) {
    if (modeInfo.dmBitsPerPel < 16) continue;
    modes.push_back( modeInfo );
}

问题是,我正在获得平移模式!我无法分辨哪个是哪个;例如我的ATI笔记本电脑的最大正常模式为1280x800,但也包含1024x600的平移模式!

任何人都知道区分2的方法,所以我可以拒绝菜单中的平移模式吗?

1 个答案:

答案 0 :(得分:1)

@Martin:我猜OP只是把res放错了。

this link是关于你要找的东西吗?

看起来这是在Windows中获取屏幕像素尺寸的正确方法。