Re: OpenGL and Document-Based Cocoa app
Re: OpenGL and Document-Based Cocoa app
- Subject: Re: OpenGL and Document-Based Cocoa app
- From: Brent Gulanowski <email@hidden>
- Date: Sun, 24 Mar 2002 10:58:09 -0500
On Sunday, March 24, 2002, at 09:44 AM, MoreMasters wrote:
Is there a way to ensure MyOpenGLView is dealloc'd first?
Is it shamefully obvious to someone that I'm going at this the totally
wrong way?
Is it the done thing to send data to the GLView, rather than have the GL
side ask for it?
Hi. I'm actually a newbie in Cocoa (and OpenGL), but just this week I
figured out how to show OpenGL *without* using NSOpenGLView. I made my own,
actually. Perhaps there's a bug in NSOpenGLView, so you should report it.
As a workaround, try subclassing NSView and putting an NSOpenGLContext
inside. I should think you'd be able to manage your own deallocation in
that case.
The only thing I haven't been able to do elegantly is NSOpenGLContext's
-setView:(NSView). I can't call it in -awakeFromNib, or in -initWithFrame:
, or even in -viewDidAttachToWindow -- the drawable isn't "ready" yet and
I get an error. I have to do a one-time-only in -drawRect:.
If you like this idea and can improve my approach, I'd love to hear back.
Cheers,
Brent
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.