我下载并安装了最新版本的Xamarin Studio和MonoGame。然后我创建了一个全新的MonoMac
项目。
我在我的/ Content目录中添加了一个.jpg文件,并尝试使用Content.Load<Texture2D>
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
当应用程序运行时,这就是我在Windowed中获得的是挂起的应用程序,甚至不是渲染的CornFlowerBlue:
当我在全屏幕中投放时,会生成一个detailed message,以便我在此帖子中加入。{/ p>
当我尝试加载内容时,会发生什么导致应用程序永久挂起或崩溃?