Skip to content

Commit

Permalink
Merge pull request #4879 from dellis1972/graphicsmodesort
Browse files Browse the repository at this point in the history
Fixed the DisplayMode Ordering so it orders the display modes from smallest to highest.
  • Loading branch information
tomspilman committed May 30, 2016
2 parents 965f94e + fc06a6c commit 5a2b6fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MonoGame.Framework/Graphics/GraphicsAdapter.cs
Expand Up @@ -329,6 +329,11 @@ public DisplayModeCollection SupportedDisplayModes
adapter.Dispose();
dxgiFactory.Dispose();
#endif
modes.Sort (delegate (DisplayMode a, DisplayMode b) {
if (a == b) return 0;
if (a.Format <= b.Format && a.Width <= b.Width && a.Height <= b.Height) return -1;
else return 1;
});
_supportedDisplayModes = new DisplayModeCollection(modes);
}

Expand Down

0 comments on commit 5a2b6fe

Please sign in to comment.