Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (3 posts)

How do classes that need the graphics device in their constructor get loaded with Content.Load

Last post 4/1/2011 6:47 PM by JCBDigger. 2 replies.
  • 4/1/2011 1:59 PM

    How do classes that need the graphics device in their constructor get loaded with Content.Load

    The model class is an example that includes other classes that have a constructor that requires the graphics device.  In this case, BasicEffect needs it.

    How can I create my own class that loads with the Content Pipeline that includes a class that needs the graphics device?

    Is there an interface or something I need to include for use by Content.Load that I can override?

    Thanks


    This is related to another thread I just posted.  http://xboxforums.create.msdn.com/forums/p/79537/481552.aspx#481552

  • 4/1/2011 5:26 PM In reply to

    Re: How do classes that need the graphics device in their constructor get loaded with Content.Load

    Query reader.ContentManager.ServiceProvider for IGraphicsDeviceService, then get the GraphicsDevice instance from the IGraphicsDeviceService interface.
  • 4/1/2011 6:47 PM In reply to

    Re: How do classes that need the graphics device in their constructor get loaded with Content.Load

    Thank you
Page 1 of 1 (3 posts) Previous Discussion Next Discussion