1
\$\begingroup\$

I'm developing an engine in XNA and would like to have two different ContentManagers: one for the game (sprites, sounds, etc.) and one for the engine (shaders, dlls, etc.)

Right now, I have this:

using Microsoft.Xna.Framework;
....
public class Engine
{
    public ContentManager GameContent;
    public ContentManager EngineContent;
    public IServiceContainer Services = null;

    public Engine(GraphicsDeviceManager Graphics, ContentManager Content)
    {
        Services = new ServiceContainer();
        Services.AddService(typeof(IGraphicsDeviceService), Graphics);
        Services.AddService(typeof(IGraphicsDeviceManager), Graphics);
        GameContent = Content;
        EngineContent = new ContentManager(Services, "EngineContent");
        ...
    }
}

The GameContent and EngineContent projects root directories are set to GameContent and EngineContent, respectively. I have a content reference to EngineContent in the Engine project and references to both GameContent and EngineContent in the Game project.

Why can I access my GameContent but not my EngineContent?

\$\endgroup\$
2
  • \$\begingroup\$ Out of curiosity, why do you want to do that? \$\endgroup\$ Commented Nov 6, 2011 at 22:52
  • \$\begingroup\$ I'm trying to build an engine completely separate from my game. But I want to be able to implement certain graphical features straight from the engine so I need to be able to use my .fx files. \$\endgroup\$
    – Mike Cluck
    Commented Nov 7, 2011 at 2:06

1 Answer 1

1
\$\begingroup\$

I found the problem. Something about referencing the engine content from both the game and the engine was messing it up. Removing the EngineContent reference from the game cleared it up.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .