如何在 Lion 中切换 OpenGL 全屏渲染?
当我的窗口全屏显示时,我必须做什么才能获取新的更高分辨率视图的 OpenGL 渲染上下文(或更改现有的上下文)?
现在在窗口委托中,我有
- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize {
return [theOpenGLView bounds].size;
}
这相当毫无意义,因为我只是在大规模亚麻布背景上得到相同大小的窗口。 我尝试返回 [[NSScreen mainScreen] frame].size
但这只是将我的 OpenGL 窗口放在角落里,屏幕的其余部分被灰色视图背景覆盖。我尝试更新我的 glViewport
和投影矩阵并调用 [myNSOpenGLContext update]
但这也不起作用。
所有苹果文档似乎都是针对旧的全屏系统。如果有人能够列举正确执行此操作所需的步骤,我将不胜感激。
When my window goes fullscreen, what must I do to obtain an OpenGL rendering context (or change the existing one) for the new higher resolution view?
Right now in the window delegate I have
- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize {
return [theOpenGLView bounds].size;
}
Which is fairly pointless as I just get the same sized window on a massize linen background.
I tried returning [[NSScreen mainScreen] frame].size
but this just put my OpenGL window in the corner and the rest of the screen was covered by the greyish view background. I tried updating my glViewport
and projection matrix and calling [myNSOpenGLContext update]
but this didn't work either.
All the apple documentation seems to be for the old fullscreen system. I would appreciate if someone could enumerate the steps required to do this properly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是我的视图没有自动调整大小,因此尽管窗口占据了整个屏幕,但视图是固定的。现在我必须弄清楚如何让转变看起来不那么可怕......
The problem was that my view wasn't autoresizing, so although the window took up the whole screen, the view was fixed. Now I have to figure out how to make the transition not look horrendous…