On Mon, Oct 12, 2009 at 11:30 PM, Richard Somers <[email protected] > wrote:
> So you are saying that I should abandon this and put the draw method > somewhere else like in a controller. Perhaps you could fill the picture in a > little more for me. So far I have yet to find any sample code that is a > document based core data application that uses OpenGL. > There is no strictly correct way of solving your problem. Below are my recommendations. Design your model objects as data containers. Hence no drawing behavior in model objects. If you add behavior to your model objects, make minimal assumptions about the world outside the model objects. Have separate classes that know how to draw your model objects in a particular rendering technology. For OpenGL, have a custom NSOpenGLView class that knows how to translate your model objects to OpenGL commands. Create a controller class that acts as a resource manager. Make the controller decide when to allocate an OpenGL context, how many of them to have around, how the contexts are associated with the views, and generally make it orchestrate the whole thing. If your design does not fit this model well, then consider changing your design. /Dado _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
