OpenGL view first frame flickers garbage
In my OpenGL game, the view always shows random garbage immediately upon launching and then starts rendering. How can I prevent this? The view is created in the nib, would it fix this if I did it programmatically? I'm using a custom NSView, not NSOpenGLView.
Clear the framebuffer as soon as it's loaded instead of waiting for the first frame to clear it. Or don't display the framebuffer until you've drawn the first frame.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
What do you mean the framebuffer? How can I stop it from displaying?
The framebuffer is the chunk of video memory that you are drawing into. You can stop it from displaying by not showing the window it's in on the screen until you've drawn the first frame.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Am I able to control that If it's created in the nib?
You control when the window appears on the screen.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
From where? The nib creates it and displays it automatically.
One of the window settings in Interface Builder is "visible when loaded" or something like that. You can uncheck that and then display the window when it's ready. Clearing the framebuffer when you first create it might be easier, but not as nice presentation wise.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Should I draw the first frame and then make the window visible in awakeFromNib, applicationWillFinishLaunching: or applicationDidFinishLaunching: (of the Application Delegate)?
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| When to create custom OpenGL view instead of subclass NSOpenGL view | Coyote | 37 | 16,911 |
Oct 20, 2009 08:16 PM Last Post: Coyote |
|
| OpenGL & Cocoa - Improving frame rate | daveh84 | 4 | 4,915 |
Feb 2, 2009 06:53 AM Last Post: backslash |
|
| OpenGL full screen mode leaves garbage on screen when exiting app | Malarkey | 5 | 4,455 |
Nov 19, 2008 12:51 PM Last Post: Malarkey |
|
| opengl view question | Leroy | 3 | 2,832 |
Jul 23, 2007 11:08 PM Last Post: AnotherJake |
|
| Porting SDL to Cocoa OpenGL view--texture problem | smittyz | 7 | 4,334 |
Jul 21, 2007 07:53 PM Last Post: smittyz |
|

