以编程方式更改分辨率OS X [英] Programmatically change resolution OS X

查看:157
本文介绍了以编程方式更改分辨率OS X的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题很简单。我正在开发一个游戏,正如标题所示,我想能够以编程方式改变OS X上的显示分辨率/刷新率。我已经搜索了几个小时,没有找到任何东西。我已经知道如何创建一个全屏窗口。

My question is simple. I am developing a game and, as the title states, I want to be able to programmatically change the display resolution / refresh rate on OS X. I've been searching for this for hours and couldn't find anything. I already know how to create a full screen window.

我也想得到支持的分辨率和刷新率的列表

I would also want to get the list of supported resolutions and refresh rates

推荐答案

来自Apple的 OpenGL Mac OS X编程指南:绘制全屏


改变由用户选择的显示分辨率。如果
你的应用程序需要以更低的分辨率渲染数据为
性能原因,你可以显式创建一个后台缓冲区的
所需的解决方案,并允许OpenGL将这些结果缩放到
显示。请参阅控制后台缓冲区大小

这就是说,如果你真的想做这个,你可以使用Quartz Display Services。请参阅更改显示模式。在更改显示配置之前,您应该真正捕获显示,如在该指南中所述,否则其他应用程序的窗口将移动和调整大小,并且您的用户会感到恼火。 (例如,他们的桌面图标可能会重新排列。)

That said, if you really want to do this, you can use Quartz Display Services. See "Changing Display Modes". You should really capture the display, as described elsewhere in that guide, before changing the display configuration or else other applications will have their windows moved and resized and your users will be annoyed. (For example, their desktop icons may get rearranged.)

这篇关于以编程方式更改分辨率OS X的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆