Hello, I'm sorry if the answer is already somewhere on forum, but I found only stuff like http://emptykeys.com/Community/aft/113
which didn't worked for me.
Window always starts with resolution 800/480, Monogame viewport.Width = 800 and Height = 480.
private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
nativeScreenWidth = 1920;
nativeScreenHeight = 1080;
graphics.PreferredBackBufferWidth = 1920;
graphics.PreferredBackBufferHeight = 1080;
graphics.PreferMultiSampling = true;
graphics.GraphicsProfile = GraphicsProfile.HiDef;
graphics.SynchronizeWithVerticalRetrace = true;
graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleCount = 16;
void graphics_DeviceCreated(object sender, EventArgs e)
Engine engine = new MonoGameEngine(GraphicsDevice, nativeScreenWidth, nativeScreenHeight);
I couldn't make resizing work also.
I tried stuff like this:
Window.ClientSizeChanged += graphics_HandleResizing;
private void graphics_HandleResizing(object sender, EventArgs e)
viewport = GraphicsDevice.Viewport;
viewport.Width = Window.ClientBounds.Width;
viewport.Height = Window.ClientBounds.Height;
But it does nothing.
Then I tried to debug stuff.
And discovered that if I place values i need in Renderer.Engine.NativeScreenWidt and Native ScreenHeight then everything works fine! I want so much something like:
engine.Renderer.NativeScreenWidth = Window.ClientBounds.Width;
engine.Renderer.NativeScreenHeight = Window.ClientBounds.Height;
But the fields are private.
So I've tried creating new Engine in my graphics_HandleResizing:
Engine engine = new MonoGameEngine(GraphicsDevice, Window.ClientBounds.Width, Window.ClientBounds.Height);
but engine still always has Renderer.Engine.NativeScreenWidth = 800 and Native ScreenHeight 480
Debugger says stuff like
public MonoGameEngine(GraphicsDevice graphicsDevice, int nativeScreenWidth, int nativeScreenHeight)
this.renderer = (Renderer) new MonoGameRenderer(graphicsDevice, nativeScreenWidth, nativeScreenHeight);
But what really happens, from where it takes 800 and 480?.. Lost 3 days now and I am beyond thinking that I'm stupid... Please help.