NSOpenGLConext and upate

Joined
May 31, 2011
Messages
1
Reaction score
0
Points
1
Hi all. I have a trouble with using Cocoa with OpenGL. Porblem occurs when i switch window (with NSOpenGLContext object attached) to windowed mode. I doing this by
[window setHidesOnDeactivate:NO];
[window setStyleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask];
[window setTitle:[[NSString alloc] initWithCString:window->caption.c_str()]];
[window setLevel: NSNormalWindowLevel];
[NSMenu setMenuBarVisible:YES];
then i change window size by
[(NSWindow*)window setFrame:rect display:YES];
and finally I call
[gl_context update];
Sometimes (one case to ten) half of sreen remain covered by garbage from previous frame, and nothing can be drawn over this garbage :(
This issue disappears only if i call
[gl_context update];
each time when i draw new frame, but this leads FPS down to 30 (from 400 without).
Can i find any method to determine when i must call update, and then i must not?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top