在经典的XNA应用程序中,此值通过应用程序属性设置。
默认情况下,此值设置为HiDef
,至少在我当前使用的计算机上。但必须将其设置为Reach
才能运行。
我的问题是我没有找到任何方法来使用monogame有效地改变这个值。属性窗口显然与XNA不同,我没有找到任何配置值。
在Game
构造函数或LoadContent
方法中更改代码中的值并不能解决我的问题。
PS:我认为我原来的问题是由GraphicsDevice.GraphicsProfile
导致的https://stackoverflow.com/questions/11900957/monogame-draw2d-sample-accessviolation-exception
答案 0 :(得分:1)
在构造函数metod中,为GraphicsDeviceManager创建新的事件处理程序:
graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs (graphics_PreparingDeviceSettings);
(默认处理程序是通过在+ =之后双击Tab创建的)
然后在事件处理程序中添加以下代码
void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
e.GraphicsDeviceInformation.GraphicsProfile = GraphicsProfile.Reach;
}