Fullscreen Frustrations - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Fullscreen Frustrations (/thread-1781.html)
Fullscreen Frustrations - robotseatpeople - Feb 9, 2009 02:52 PM
I'm having difficulties getting fullscreen mode to work right. At the moment it's set up as a windowed/fullscreen deal. Whenever I enter fullscreen whatever was drawn in the window disappears.
Here's my code:
My view extends NSOpenGLView. I'm new to this so I understand that whatever I have is probably completely wrong. I've looked at the NSOpenGL Fullscreen example provided by Apple but I'm a little lost. I've Googled my brains out and haven't really come up with anything that I've found useful. Any help would be appreciated!
Fullscreen Frustrations - backslash - Feb 10, 2009 06:18 AM
Two things stand out immediately:
1 - you have to share your windowed OpenGL context with the fullscreen conext so that your textures and things are available to both.
2 - you have to make sure the correct context is current when you want to draw. You could either do this manually at the start of drawrect: or set your fullscreen context as the context for your NSOpenGLView (which automatically makes its own context current before calling drawrect). Watch out for memory leaks if you choose that method.