Re: OpenGL and Document-Based Cocoa app
Re: OpenGL and Document-Based Cocoa app
- Subject: Re: OpenGL and Document-Based Cocoa app
- From: MoreMasters <email@hidden>
- Date: Sun, 24 Mar 2002 16:29:20 -0100
Thanks for you comments Brent,
I've considered this way round the problem, and I'm pretty sure it'd
work fine, especially as I'd be instantiating my OpenGL class
programmatically from within the controller class, but can't find a way
to set outlets between the two without using IB. I need the two classes
to be able to talk to each other, rather than a one-way thing from the
controller class to the OGL class. Maybe I've just gone a bit
code-blind...
Cheers, MM
On Sunday, March 24, 2002, at 02:58 PM, Brent Gulanowski wrote:
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.