سؤال

In a classic XNA application this value is set through the application properties.

By default this value is set to HiDef, at least on the machine I am currently using. But it has to be set to Reach to run.

My problem is that I did not find any way to effectively change this value using monogame. The property window is obviously not the same as with XNA and I did not find any config values.

Changing the value in the code, in the Game constructor or the LoadContent method does not solve my problem.


PS: My original problem, which I think is caused by this GraphicsDevice.GraphicsProfile, is https://stackoverflow.com/questions/11900957/monogame-draw2d-sample-accessviolation-exception

هل كانت مفيدة؟

المحلول

In constructor metod, create new event handler for your GraphicsDeviceManager:

graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs (graphics_PreparingDeviceSettings);

(default handler is created by doubletapping Tab after +=)

then in event handler add folowing code

void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
e.GraphicsDeviceInformation.GraphicsProfile = GraphicsProfile.Reach;
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top