0

I downloaded and installed the latest version of Xamarin Studio and MonoGame. I then created a brand new MonoMac project.

enter image description here

I added a .jpg file to my /Content directory and tried to load it using Content.Load<Texture2D>

enter image description here

public class Game1 : Game
{
    GraphicsDeviceManager graphics;
    SpriteBatch spriteBatch;

    public Game1 ()
    {
        graphics = new GraphicsDeviceManager (this);
        Content.RootDirectory = "Content";              
        graphics.IsFullScreen = false;      
    }

    protected override void Initialize ()
    {
        base.Initialize ();

    }

    protected override void LoadContent ()
    {
        spriteBatch = new SpriteBatch (GraphicsDevice);
        Content.Load<Texture2D> ("woodroom");
    }

    protected override void Update (GameTime gameTime)
    {
        #if !__IOS__
        if (GamePad.GetState (PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
            Keyboard.GetState ().IsKeyDown (Keys.Escape)) {
            Exit ();
        }
        #endif

        base.Update (gameTime);
    }

    protected override void Draw (GameTime gameTime)
    {
        graphics.GraphicsDevice.Clear (Color.CornflowerBlue);
        base.Draw (gameTime);
    }
}

When I call Content.Load<Texture2D> the app hangs. I have set the woodroom.jpg so that it Copies to Output when newer and I've changed it's Build Action to Content

enter image description here

When the app runs, this is all I get in Windowed is the hung app, not even the rendered CornFlowerBlue:

enter image description here

When I run in fullscreen it generates a detailed message that is to long for me to include in this post.

What is happening that causes the app to hang forever, or crash, when I attempt to load the content?

Johnathon Sullinger
  • 7,097
  • 5
  • 37
  • 102

0 Answers0