Get the supported screen resolutions in XNA?

.net, c#, xna

Solution

Just use this:

foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) {
    //mode.whatever (and use any of avaliable information)
}

But it will give you few duplicates, because it also takes into accound refrash rate, so you might include that aswel, or do some filtering.

Problem

How can I get the supported screen resolutions in XNA? Like when you change the screen resolution in windows, and instead of giving you a list of all the possible choices, it gives you just a few of them.

Original source