• 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
Core Data with OpenGL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data with OpenGL


  • Subject: Core Data with OpenGL
  • From: Richard Somers <email@hidden>
  • Date: Mon, 12 Oct 2009 08:47:52 -0600

Consider an application using Core Data and OpenGL.

Normally a model object (MVC) has no knowledge of views or controllers but in this case it must draw itself. When the draw method is called by the view or controller the appropriate OpenGL context is current. So far so good. The problem however is with OpenGL resources needed to support drawing.

When a model object is added to the managed object context, specific OpenGL resources need to be created. When a model object is removed from the managed object context, OpenGL resources need to be cleaned up.

A seemingly straight forward solution would be to do the OpenGL initialization and cleanup work in the awakeFromInsert, awakeFromFetch, and didTurnIntoFault methods of NSManagedObject. The problem is however, the OpenGL context is not current when these methods are called. These methods are called by the Core Data framework which has no knowledge of the OpenGL context.

Any suggestions or comments?

Richard

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Core Data with OpenGL
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Binding "hidden" attribute
  • Next by Date: Hiding tab view items
  • Previous by thread: Re: Illegal attempt to establish a relationship 'xyz' between objects in different contexts
  • Next by thread: Re: Core Data with OpenGL
  • Index(es):
    • Date
    • Thread