I found this good little bit of code on Ziggyware that will both detect maximum screen resolution (given a list of possible screen resolutions & whether or not to run full screen) and switch the screen to that resolution ( and full screen, if enabled).
It can be found here.
Just a note, you probably want to have the resolution checks/changing in the DmaGame initialization before the DmaGame stores the width and height.
Also to add screen resolutions, where you put in:
-
-
-
if (!InitGraphicsMode(1280, 720, true))
-
{
-
if (!InitGraphicsMode(1024, 768, true))
-
{
-
if (!InitGraphicsMode(800, 600, true))
-
{
-
if (!InitGraphicsMode(640, 480, true))
-
{
-
this.Exit();
-
}
-
}
-
}
-
}
add your own resolutions to the list.