在代码中区分平移和正常屏幕模式 - Windows

发布于 2024-09-11 06:16:06 字数 515 浏览 1 评论 0原文

我正在编写一个全屏 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

复古式 2024-09-18 06:16:06

@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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文