Programmatically change resolution OS X

前端 未结 1 889
一生所求
一生所求 2021-02-06 17:40

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 se

1条回答
  •  无人及你
    2021-02-06 18:19

    From Apple's OpenGL Programming Guide for Mac OS X: Drawing to the Full Screen:

    Avoid changing the display resolution from that chosen by the user. If your application needs to render data at a lower resolution for performance reasons, you can explicitly create a back buffer at the desired resolution and allow OpenGL to scale those results to the display. See “Controlling the Back Buffer Size.”

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

    0 讨论(0)
提交回复
热议问题