加载Texture2D全屏崩溃,在Windows模式下挂起

时间:2016-03-06 17:30:10

标签: macos mono xna monogame xamarin-studio

我下载并安装了最新版本的Xamarin Studio和MonoGame。然后我创建了一个全新的MonoMac项目。

enter image description here

我在我的/ Content目录中添加了一个.jpg文件,并尝试使用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);
    }
}

当我拨打Content.Load<Texture2D>时,应用程序会挂起。我设置了woodroom.jpg,以便在更新时将其复制到输出,并且我将其构建操作更改为Content

enter image description here

当应用程序运行时,这就是我在Windowed中获得的是挂起的应用程序,甚至不是渲染的CornFlowerBlue:

enter image description here

当我在全屏幕中投放时,会生成一个detailed message,以便我在此帖子中加入。{/ p>

当我尝试加载内容时,会发生什么导致应用程序永久挂起或崩溃?

0 个答案:

没有答案