|
|
NSOpenGLView vanished on minimize
|
|
|
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
Hello ...
When my not-full-screen window minimizes to the Dock, an NSOpenGLView within it disappears, either turning completely white or just not drawing at all. I've found references to this issue (which also comes up in the context of trying to capture a screenshot of a window with an NSOpenGLView), but I haven't come across a solution.
Is there a straightforward (or even a complicated) workaround?
I'm working in Panther, although I'd like backwards-compatibility with Jaguar.
Thanks and regards ...
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jul 2002
Status:
Offline
|
|
The Dock genies the Quartz surface behind the GL surface, so it shows up white. It really ought to handle the GL surface for you, but...
Anyway, there is a workaround. You have to copy the GL surface content onto the Quartz surface. I've posted code to do it here. This code is a simplified version based on Apple's GLUT implementation, so it is intended for simple cases where your GL view fills the entire window as in a game. If you have multiple GL views or GL views mixed with other controls, go check the full GLUT source which handles all of those cases.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
Thanks, arekkusu!
I made two minor changes to accommodate a couple of variables
Code:
[[myGLView openGLContext] makeCurrentContext]; // for [ctx makeCurrentContext];
[...]
[minicon drawInRect:[myGLView bounds]]; // for [minicon drawInRect:frame];
but otherwise the code worked right away to fix the minimizing problem.
However, the problem returns on *deminimizing*. Advice?
DayLateDon
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jul 2002
Status:
Offline
|
|
No problems deminimizing in any of my applications here under 10.2 or 10.3, with the same code. You will be sent a drawRect at both the begin and end of the deminimization, so double check your rect bounds and state; maybe you're not drawing the scene properly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|