Prevent users from choosing unproper resolutions

Hello there I’m currently attempting to create a resolution settings menu for a game and everything works so far, I can successfully change resolution and have no problems whatsoever. BUT I use mouse control in my game and my max screen resolution is 1366x768 when I change the resolution to one with higher width/height than it can actually take however… I have this “problem”: Whelp the game draws the highest possible max resolution on my screen for example:

1920x1020 becomes 1366x768 since 1366<1920 and 768<1020
1152x864 becomes 1152x768 since 1366>1152 and 768<864

/-------------\ ======== 1920 x1020
| 1366 x. .|, ,||
| 768 …|,||
\ ------------/ ,||
||, ||

This mainly causes 2 problems:

  1. Simply awkward resolutions 1152x768, wut?
  2. As I tried to show above: the 1366x768 is my computer screen and I try to draw a 1920x1020 resolution on it, it draws everything on the 1366*768 but the “mouse region can’t reach anything outside” that 1366x768 upper left box because of the way I currently “upscale” the mouseposition to get a standard mouseposition in every screenresolution (sorry if this sounds difficult/elaborate but it works very good on lower resolutions and ofcourse your best resolution) this causes the mouse input not to match with the actually game input. How do I know this? Well I tried my application on my friends computer with a 1920x1020 resolution and didn’t encounter any problems every resolution worked fine on it…

Now I actually do know how to fix this, I just don’t know if there pre-existing fields/methods that can make my life alot easier: - Is there a way that I can ask the maximum resolution of a screen (like in my case 1366x768) through the XNA (or monogame) framework? This is not “GraphicsDevice.preferredBackBufferWidth/Height” because that gives me my “virtual screen” resolution…

  • If not, is there any other way to prevent users from setting a higher resolution than they actually can?

But everything works fine if the user chooses a resolution that his screen can handle…

Phew I hope you get the current problem I’m having a little bit…

PS: I still haven’t gotten
to work I just can’t get fullscreen for some reason :confused: I’m still using maximum screen resolution + borderless windows to work around this…

Thanks a lot.

they are looking at the isfullscreen now its up on the issue page
its broke its been broke right now its really broke
maybe partially cause their is more then one call to isfullscreen graphicsdevice and the graphicdevicemanager both have ways to get and set it
plus the graphics device information class has a broken but existing accessor to it
dunno whats up with it , tis all messed up

the way you prevent that in windowed mode is by getting the width height of the current resolution and holding yourself a pair of variables for setting the prefered back bufer w h
you check those variables before you apply the changes to make sure they are less
(in windowed mode) then the current w h of the resolution your in.

you want to take a look at urgraphicsdevice.Adapter.CurrentDisplayMode. w h

Console.WriteLine("Current display mode: "+device.Adapter.CurrentDisplayMode.Width + “,” + device.Adapter.CurrentDisplayMode.Height);

Ah yes, that will do… I did know how to fix it I just didn’t have that width and height to fall back to up until now, thanks.And thanks for clarifying the fullscreen problem.

Here is the issue for fullscreen with Windows GL: