在代码中区分平移和正常屏幕模式 - Windows
我正在编写一个全屏 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 的平移模式!
有人知道区分这两种模式的方法,这样我就可以从菜单中拒绝平移模式吗?
I am writing a full-screen 3D game and I have created a menu in which the user may select the screen resolution to match his hardware capacity.
I am enumerating all the available screen modes with EnumDisplaySettingsExA
like this:
std::vector<DEVMODEA> modes;
DEVMODEA modeInfo;
int modeNum = -1;
while (EnumDisplaySettingsExA(0, ++modeNum, &modeInfo, 0)) {
if (modeInfo.dmBitsPerPel < 16) continue;
modes.push_back( modeInfo );
}
The problem is, I am getting panning-modes as well! I can't distinguish which are which; for example my ATI laptop has a maximum normal mode of 1280x800, but also contains a panning-mode of 1024x600!
Anyone knows of a way to distinguish between the 2, so I can reject panning-modes from my menu?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@Martin:我猜OP只是把res的顺序放错了。
此链接是关于您的内容吗?正在寻找?
看起来这是在 Windows 中获取屏幕像素尺寸的正确方法。
@Martin: I'm guessing the OP just put the res's in the wrong order.
Is this link about what you're looking for?
It looks like it's the proper way to get the pixel dimensions of a screen in Windows.