This可能是相关的。
我在 Update
方法中有这段代码:
protected override void Update(GameTime gameTime)
{
graphics.PreferredBackBufferWidth = 1024;
graphics.ApplyChanges();
base.Update(gameTime);
}
奇怪的是,在 ApplyChanges
行之后,我的 LoadContent
方法又被调用了。这种情况一遍又一遍地发生。
为什么会发生这种情况,我该如何预防?
最佳答案
假设 graphics.PreferredBackBufferHeight
为 0,您提供的链接实际上是相关的。您可以使用 the answer 来防止这种情况发生。在您提供的链接上提供。此外,在应用更改之前,您应该确保 graphics.PreferredBackBufferHeight
的值大于零。
关于c# - 更改图形设置调用 `LoadContent`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13775534/