Are you running your game in hardware full screen? Does the player have multiple monitors connected? Do you set the window position manually?
Is this a DesktopGL or DX project?
Hard full screen (or real full screen) is the default, so that is what you are using. If you are using MG 3.6 or newer his is likely an issue on the side of the player, because MonoGame uses SDL2 for windowing since 3.6 which is a pretty robust and widely used library.
That said, you can probably help him work around it by providing the option to set soft full screen instead of hard full screen. Soft full screen is a fake kind of fullscreen that just makes the window of your game the size of the desktop and removes the window border. It does not allow you to mode switch (that is, switch the desktop resolution) like in hard full screen. Soft full screen is less complex, so I think it is a lot more likely to work correctly.
I am using 3.6.
And screen resolution is 1920*1080.
Ok to make the edit to use soft full screen but i don’t know how we do it.
Is it simply done by replacing : screen.IsFullScreen = true;
by screen.IsBorderless = true;
?
That’s not working as usual on computer/screen where it was working as expected.
Now the game that i was streching to the screen (from 1366768 default size to screen resolution) is not stretched anymore but displayed in top left corner at a 1366768 size and the rest of the screen is filled in black.
Also, i cannot do any screenshot of this. It captures what’s under the game instead (like Visual Studio for example)…
In soft full screen the display mode is not switched, like I said earlier, so your backbuffer size is the actual desktop resolution.
It seems your code expected that a 1366x768 resolution is always supported by the display. That might actually be part of the issue for your player. You would get the same issue you have now with hard full screen if the display does not support that resolution.
It’s good practice to render your game to a RenderTarget first and then scale it as appropriate and optionally use pillar- or letterboxing so the game is not stretched. MonoGame.Extended has some classes that make this easy.
How are you taking a screenshot? On Windows, try using the Snipping Tool.
If you want it to stretch, it’s the same. You need to render to a RenderTarget first, then to the backbuffer. There’s no other way in soft full screen.
The original issue is because that user’s monitor does not support the screen resolution you are trying to set. This is why many games and even Windows will display a dialog box asking if the resolution change worked, with a countdown timer that reverts to the previous setting if the user does not click “Ok”.
Some games will also provide the graphics options in a standard Windows dialog before the game itself starts. This allows the user to select a graphics mode that they know their card and monitor support.
It is also common practice to start up for the first time in either the user’s desktop resolution (because you know that works) or a lower and more standard resolution, such as 800x600 or 1024x768. These are very likely to be supported, and are more likely to be supported than 1366x768.
For the screenshot issue, how are you trying to take the screenshot? Alt+PrtScn or the Snipping Tool? What mode is the Snipping Tool in? Window, full-screen?
That’s what i am working on @KonajuGames and @Alkher. A gamedev mate suggested it also.
I didn’t tried RenderTarget solution yet from @Jjagg because it sounds more like a change that could have potential repercussions on the way i already handle graphics in the game. Because i know nothing about RenderTarget.
However, if GraphicsAdapter.DefaultAdapter.SupportedDisplayModes solution i’m working on don’t work correctly, i will try to use RenderTarget2D.
Simply put, RenderTargets are “just” a simple buffer where you tell the app to draw (ie: offscreen), then you do with this screen what you want: apply effects+shaders, scale/stretch, draw/show it.
This is not a case of trying to use an unsupported video resolution. The GPU supports the video resolution, but the display device does not. The GPU and game keep going along quite happily because to them everything is fine.
public override void Draw(GameTime gameTime)
{
graphicsDevice.Clear();
spriteBatch.Begin();
// Do drawing
spriteBatch.End();
}
the simplest way to adapt to using a RenderTarget2D is
public override void Initialize()
{
base.Initialize();
// Create the render target at the desired resolution
rt = new RenderTarget2D(graphicsDevice, 1366, 768, ...);
}
public override void Draw(GameTime gameTime)
{
// Render the scene to the render target
graphicsDevice.SetRenderTarget(rt);
// Same rendering code as before
graphicsDevice.Clear();
spriteBatch.Begin();
// Do drawing
spriteBatch.End();
// Redirect rendering to the back buffer
graphicsDevice.SetRenderTarget(null);
spriteBatch.Begin();
// Draw rt to fill viewport of the GraphicsDevice
spriteBatch.Draw(rt, ...);
spriteBatch.End();
}
This is only the resolution of the gpu, not the screen? Ain’t there a way to get them?
Apart from changing it and waiting for the user to confirm or revert to the previous one working
The physical display can only try to show what the GPU sends to it. It doesn’t report back if it cannot display it. We set the resolution on the GPU. The GPU generates the video signal from that back buffer at the specified width, height and refresh rate and sends it to the physical display.