Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > NSOpenGLView vanished on minimize

NSOpenGLView vanished on minimize
Thread Tools
DayLateDon
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Sep 5, 2004, 07:25 AM
 
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 ...
     
arekkusu
Mac Enthusiast
Join Date: Jul 2002
Status: Offline
Reply With Quote
Sep 5, 2004, 06:01 PM
 
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.
     
DayLateDon  (op)
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Sep 5, 2004, 07:33 PM
 
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
     
arekkusu
Mac Enthusiast
Join Date: Jul 2002
Status: Offline
Reply With Quote
Sep 6, 2004, 02:35 PM
 
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 Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 11:00 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,