Which screen resolutions can I use?

BlitzMax Forums/BlitzMax Programming/Which screen resolutions can I use?

GfK(Posted 2010) [#1]
I guess everyone will be queueing up to tell me about GraphicsModeExists() and GraphicsModes() and the like. But wait...

During Magicville's QA it came to light that some resolutions which show up, are not actually supported by the hardware. This was, in my case, down to the QA people's PC using a generic monitor driver, which resulted in a complete crash if the user selected a resolution that the hardware couldn't display. As a result and to get the game out, I had to drop the changeable resolution and run at fixed 800x600.

I've recently done a bit of testing on the issue and found that:

1. CreateGraphics() still returns a graphics object, even if the hardware doesn't actually support the selected mode.

2. Encapsulating the whole thing in a Try/Catch scenario was a complete waste of time.

Is there any way (preferably cross-platform - not that I know this is even an issue on Mac) of correctly querying a graphics mode to confirm whether or not the hardware is actually capable of displaying it? Ideally you'll want to be testing this with generic display drivers that offer you all sorts of display modes rather than hardware-specific ones.


H&K(Posted 2010) [#2]
I nearly always start in the operating system current res, and then simply ask, with the 15 secs to confirm thing to ... well confirm

ATM in widows, I dont even open a new screen, just a borderless window the desktop size, to ask for user res, or more generally just to run like that al la amiga

Last edited 2010


Jesse(Posted 2010) [#3]
I don't believe there is a better way than what H&K suggested as windows it self does the same thing before switching modes. the problem is that there are no drives for monitors therefore everything has to be done on a trial and error bases. My monitor came with a user's manual which documented every available mode and refresh rates but I doubt most users have ever seen any documentation for their monitor at all. I don't even know where mine's is anymore.


ima747(Posted 2010) [#4]
Personally what I do is Use GraphicsModes() to grab a list. I parse that list to trim out any modes that are just pointless (too small, too low bitdepth, etc.) then as as been suggested above do the same thing the OS does. When a user selects a resolution you give them 15-30 seconds to confirm (pretty much all big commercial games do this as well). If they fail to confirm you reset. If it crashes they can't confirm, and I would personally chalk that up to incompatible hardware (really, what graphics card with decent drivers is going to actually crash a program for selecting a resolution... that's just poor design on their part).

These are the headaches of a flexible platform, sometimes things just don't work due to no fault of your own.


Czar Flavius(Posted 2010) [#5]
Doing the 15 sec wait thing is a good catch-all. You could filter this list for only "common" resolutions, such as 800x600 and 1024x768, but not 890x445, and have an advanced option to set a custom resolution for those who know their hardware.


SLotman(Posted 2010) [#6]
Cannot stress this enough:

Get the desktop resolution.

If you don't want to run at desktop res, then render at lower res, then scale it up to desktop res.

Also, some monitors will render things blurry if not on native resolution, so there isn't much beyond the desktop resolution that you can use.

And you can always let the option to the user change the 'default' resolution.


GfK(Posted 2010) [#7]
Using the desktop res won't work. Somebody here mentioned a while back that creating a graphics object the size of the desktop caused a MAV on some systems, so I don't wanna be defaulting to that.

But anyway - none of that answers the question of how to check if the creation of a graphics object was unsuccessful without the whole thing blowing up.


H&K(Posted 2010) [#8]
I dont remember that

Ive started a thread to see if any solid info is available

http://www.blitzbasic.com/Community/posts.php?topic=92881