Deminiaturizing NSOpenGLView in NSScrollView is White

Moderator
Posts: 3,573
Joined: 2003.06
Post: #1
Background: I started making a tool using OpenGL for the graphics. I have a window with an NSOpenGLView grouped inside an NSScrollView, because the OGLView can be larger than the window in this instance. No problems with any of that, although it was a little tricky getting the scrolling to work right at first.

Problem: We know that windows don't retain OpenGL pixels when they're miniaturizing so I use the NSDrawBitmap technique to draw the OGL graphics into the window's backing store (or so I thought) when the windowWillMiniaturize: notification is received. Great, so this trick works just fine for miniaturizing, and the icon in the dock looks perfect, but when I *deminiaturize* the icon it draws white where the OGLView is supposed to be during the genie effect. I've used this technique before without any problems, but when I group the OGLView within a ScrollView the problem occurs.

I'm not drawing on a timer for this project since it doesn't need it. I thought maybe the graphics might need to be drawn again while it's in the dock but that doesn't fix it either. I can't seem to figure out a way around this. I'm not too terribly disappointed that it only happens while deminiaturizing and I can probably live with it, but... You would think that since all the graphics made it to the dock icon safely they'd still be there on the way out, but that does not necessarily seem to be the case.

Any ideas?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
tried calling -setDrawsBackground:NO on your scroll view?
Quote this message in a reply
Moderator
Posts: 3,573
Joined: 2003.06
Post: #3
Yes! Nailed it! I went over setDrawsBackground at least fifteen times today and did not see it as being related. Thanks a million *again* OSC!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Nothing showing up in NSOpenGLView [newb] binaryinsomnia 6 6,390 Nov 29, 2011 07:04 PM
Last Post: binaryinsomnia
  Cocoa controls on top of NSOpenGLView wadesworld 5 5,854 Apr 6, 2009 01:38 AM
Last Post: arekkusu
  Antialiasing and NSOpenGLView attributes Jar445 2 6,500 Jan 20, 2009 10:42 AM
Last Post: maximile
  Adding NSOpenGLView class in Xcode/Interface Builder 3.0 Graphic Ace 2 3,682 Dec 5, 2007 02:15 PM
Last Post: Blacktiger
  Double-Buffering with NSOpenGLView DesertPenguin 3 5,689 Aug 1, 2006 07:17 AM
Last Post: DesertPenguin