Removing an NSOpenGLView causes default background to be drawn.
Removing an NSOpenGLView causes default background to be drawn.
- Subject: Removing an NSOpenGLView causes default background to be drawn.
- From: Marc Van Olmen <email@hidden>
- Date: Wed, 15 Jul 2009 08:25:21 -0400
Hi,
When I remove and NSOpenGLView or when I close a window that has an
NSOpenGLView that area is drawn over with his default background color
(in my case this is Black).
This only happens depending on how long it takes to replace or close
that window. I can see it in my app when I quit because that takes a
while.
I have a few ideas on how I can get rid of this visual effect. But I
wanted to poke around if other people have seen it and solved it.
The effect that I see can be easily tested with any simple
NSOpenGLView application. I tested an standard cocoa sample app:
http://www.mataderu.com/xphere/info/cocoa_tut01/index.html
Cocoa Appkit is calling CGLClearDrawable on the opengl context before
it is getting removed then later on it removes the context and calls
CGSRemoveSurface this last call when that is finished calling causes
the black (or white depending your setting) area to appear.
To simulate the slow quiting/replacing i can demonstrate it with
Debugger trick:
I run it with the debugger and put a breakpoint at CGSRemoveSurface. I
quit the application, then it hits that breakpoint, and the window
still looks normal. Then when I step out of this method it becomes
white. Which is like the NSOpenGLView standard background color.....
Here is the stack trace:
#0 0x954711ad in -[NSSurface _disposeSurface]
#1 0x9679e53c in _nsnote_callback
#2 0x912d764a in __CFXNotificationPost
#3 0x912d7923 in _CFXNotificationPostNotification
#4 0x9679b690 in -[NSNotificationCenter
postNotificationName:object:userInfo:]
#5 0x967a4ee8 in -[NSNotificationCenter postNotificationName:object:]
#6 0x9553c710 in -[NSWindow _close]
#7 0x91364be5 in -[NSArray makeObjectsPerformSelector:]
#8 0x955dab93 in -[NSApplication _deallocHardCore:]
#9 0x955d98b1 in -[NSApplication terminate:]
#10 0x954fa4cb in -[NSApplication sendAction:to:from:]
#11 0x955a9108 in -[NSMenu performActionForItemAtIndex:]
#12 0x955a8e0d in -[NSCarbonMenuImpl
performActionWithHighlightingForItemAtIndex:]
#13 0x955a8a93 in -[NSMenu performKeyEquivalent:]
#14 0x955a7338 in -[NSApplication _handleKeyEquivalent:]
#15 0x954c40fb in -[NSApplication sendEvent:]
#16 0x9542162f in -[NSApplication run]
#17 0x953ee834 in NSApplicationMain
#18 0x00001b64 in main at main.m:13
Any ideas on how I can get rid of this last minute view clearing?.
marc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden