Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOpenGLView (and resizing problems)



Thanks for your responses, gentlemen.

David, when I tried your suggestion it did reduce the problem for me, but it still happened during resizes. It "popped" back into looking normal once I stopped resizing. Weird.

Keith, I also tried following your suggestion both with the NSWindow properties (buffered) as well as tinkering with the OpenGL parameters. I wasn't able to figure out how to get things fixed with that.

I do appreciate the responsiveness of y'all's suggestions!

I did stumble across something that seems to work for me, although it's a little kludgey. I'll mention it here in case somebody else someday is hitting the same problem and googles for "NSOpenGLView black resize glitch".

Basically if I detect that my view's size has changed I forcibly fill the view's rectangle with white. For me that code lives in -drawRect and looks like:

[[NSColor whiteColor] set];
[NSBezierPath fillRect:rect];

That prevents the bizarre black-blitting (I still have no idea WHY that happens, which is vaguely disturbing) in an admittedly brute-force way, but at least my frustration level has dropped from "my NSOpenGLView looks horrible!" to "I'm slightly unsatisfied with my workaround", which is way easier to deal with. :-)

--Bob

email@hidden



-------Original Message-------
> From: David Frampton <email@hidden>
> Subject: Re: NSOpenGLView (and resizing problems)
> Sent: 24 Sep 2004 02:50:52
>
> I had the same problem, and found that over-ridding the drawRect:
> method and calling [ view setNeedsDisplay:YES] instead of having my own
> drawFrame method which I called myself fixed the problem.
>
> On 24/09/2004, at 2:46 PM, Keith Bauer wrote:
>
> >>  Basically resizing a window with an NSOpenGLView inside seems to
> >> have these cosmetic glitches. Has anybody else seen these? And is
> >> there an easy way to avoid this phenomenon?
> >
> > Is your OpenGL view double-buffered?  It should be to avoid this sort
> > of thing, and Interface Builder's controls won't let you make it,
> > IIRC.
> >
> > -Keith
-------Original Message-------

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.