'snot true Greg, you’re missing what I’m saying.
By all means stash the user’s preference - but when it comes to loading the preference back again all you can do with it is use it to find the same displaymode in the list we give you, or a similar one. There is every possibility that this display mode no longer exists. This is why you can’t rely on users to choose one that works and insist upon it. You must choose from the list and you can never assume that a mode works. All you can be certain of is if the mode isn’t in the list, it’s definitely not supported; and if it is in the list, it still might not work and you might have to try a different one.
The reason we supply a list of modes is precisely so you can give the user a choice of modes that might work instead of presenting them with a list of modes that you think will work. It’s your job to filter out the modes that don’t interest you from what’s available. If you need 16 bit depth and 8 bit alpha you can throw away all modes with <16 bit depth and 0 bit alpha. When you present your list to the user, merely present the resolutions and colour depth; then pick the highest available combinations of alpha and depth from the list, in turn, until a mode works, or none work and you inform the user and remove that resolution from the list.
It’s quite complicated, but it’s foolproof, and foolproof is what we need. Especially cross-platform, where some of the complexity has come from.
We wouldn’t have this problem if there was a proper mechanism to get a true accurate list of screen modes guaranteed to work (ie. we didn’t throw Exception on setDisplayMode()). There’s WGL_ARB_pixel_format but it’s not yet widely supported on most drivers and it’s Win32 only. (So I can’t do much about that - sorry)
How many times have you seen the “Please try my game” thread somewhere on the net, followed by a bunch of “screen went black, then nothing happened” or “crashed my machine straight away” messages? Not knowing screenmodes is what causes it.
There is currently an unknown quirk in our screenmode code which will cause it to fail on dual-monitor systems. I’ll fix it soon.
Cas 