Re: design question: OpenGL and cocoa
Re: design question: OpenGL and cocoa
- Subject: Re: design question: OpenGL and cocoa
- From: mathew <email@hidden>
- Date: Sun, 13 Apr 2003 11:02:12 -0400
On Friday, Apr 11, 2003, at 01:37 US/Eastern, email@hidden
wrote:
Something to me doesn't feel right, and I am not sure what that is. I
think it
might have to do with the MyShape objects not knowing about the
context into
which it must draw to?
No, that's the right approach. If you make each shape object manage the
OpenGL context, you will (a) make a pile of unnecessary OpenGL calls
every time you draw all the shapes, reducing performance; and (b) have
a lot of unnecessarily duplicated code.
Far better is to have the redraw method of your NSOpenGLView set up the
OpenGL context once, then call the draw method of all the shapes.
Presumably you'll have a display list with all your shapes in, and can
just use an iterator to go through them.
mathew
_______________________________________________
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.