• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: design question: OpenGL and cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Access NetCDF library
  • Next by Date: Re: Move Camera in OpenGL ?
  • Previous by thread: Re: design question: OpenGL and cocoa
  • Next by thread: toolbar item validation extremely inefficient
  • Index(es):
    • Date
    • Thread