• 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
OpenGL and Document-Based Cocoa app [A SOLUTION]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OpenGL and Document-Based Cocoa app [A SOLUTION]


  • Subject: OpenGL and Document-Based Cocoa app [A SOLUTION]
  • From: MoreMasters <email@hidden>
  • Date: Sun, 24 Mar 2002 18:14:01 -0100

It's Sunday, I like distractions :)

Next time I use OpenGL, I think I'll do just as you suggest; use the GLview simply as a canvas, and move all the 'drawing' stuff out of there into the controller class.
It certainly seems a hell of a lot more neat and efficient way to do things...

I've solved the situation a few minutes ago by trapping windowWillClose in the controller class, so I can send a message to the OGL side letting it know not to bother the controller class anymore.

(I should mention that the problem with MyOpenGLClass messaging MyControllerClass when it doesn't exist only happens in the 'reshape' method, which seems to be the last thing to get called in MyOpenGLClass before it dies... so I only have to check for this in the one method.)

Thanks for your help, and enjoy the rest of your weekend!

MM




On Sunday, March 24, 2002, at 04:14 PM, Brent Gulanowski wrote:


On Sunday, March 24, 2002, at 09:44 AM, MoreMasters wrote:

MyDocument class handles the data (vertices etc etc) for the OpenGL model,
and manipulates it according to user input. MyOpenGLView asks for this data from MyDocument whenever it needs to do so, via an IBOutlet. This is the way I've done things so far, and have had no problems... all my OGL programs have been single window apps up until now.


Just another thought: is your View doing its own drawing, then? I always consider the view to be blissfully unaware of what was inside itself (for OpenGL), and let the model objects do the "drawing", or even better the window controller. Window closes, no more window controller! (At least that's how I think it works.) I hope I'm helping, not just distracting you.

bg
_______________________________________________
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: [ANN] My experiences with Apple
  • Next by Date: Re: Preventing the writing of the NSUserDefaults
  • Previous by thread: Re: NSrange utilities
  • Next by thread: Re: Preventing the writing of the NSUserDefaults
  • Index(es):
    • Date
    • Thread