Jump to content
  • Advertisement
Sign in to follow this  

[SlimDX] List of supported display modes

This topic is 2833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I have two questions about display modes in Direct3D 9.

In Managed DirectX, I used this property to fetch the list of supported display modes:
DisplayModeCollection displayModes = Manager.Adapters.Default.SupportedDisplayModes;
foreach (DisplayMode dm in displayModes) {
// Do stuff

Now, I would like to accomplish this in SlimDX. It differs slightly from MDX. You use this method:
DisplayModeCollection displayModes = direct3D.Adapters.DefaultAdapter.GetDisplayModes(Format.?);
foreach (DisplayMode dm in displayModes) {
// Do stuff

Question is, what Format do I specify? Do I iterate through all possible formats to get all display modes or is there one or a few specific ones that you only need to look at?

Second thing is, when I get all supported display modes with the MDX version, I get a list that looks like this:
640*480, 60hz, X8R8G8B8
640*480, 40hz, X8R8G8B8
720*480, 60hz, X8R8G8B8
720*480, 40hz, X8R8G8B8
720*576, 60hz, X8R8G8B8
720*576, 40hz, X8R8G8B8
800*600, 60hz, X8R8G8B8
800*600, 40hz, X8R8G8B8
1024*768, 60hz, X8R8G8B8
1024*768, 40hz, X8R8G8B8
1280*720, 60hz, X8R8G8B8
1280*720, 40hz, X8R8G8B8
1280*800, 60hz, X8R8G8B8
1280*800, 40hz, X8R8G8B8
1440*900, 60hz, X8R8G8B8
1440*900, 40hz, X8R8G8B8
640*480, 60hz, R5G6B5
640*480, 40hz, R5G6B5
720*480, 60hz, R5G6B5
720*480, 40hz, R5G6B5
720*576, 60hz, R5G6B5
720*576, 40hz, R5G6B5
800*600, 60hz, R5G6B5
800*600, 40hz, R5G6B5
1024*768, 60hz, R5G6B5
1024*768, 40hz, R5G6B5
1280*720, 60hz, R5G6B5
1280*720, 40hz, R5G6B5
1280*800, 60hz, R5G6B5
1280*800, 40hz, R5G6B5
1440*900, 60hz, R5G6B5
1440*900, 40hz, R5G6B5

This list seems to be showing all possible combinations of resolution, refresh rate and pixel format. So my question here is; can I assume that for example all refresh rates can work with any of the given resolutions, and any of the given formats? Or is it possible that maybe one format only supports one refresh rate while another supports more?

Thanks in advance!

Share this post

Link to post
Share on other sites
Internally the MDX SupportedDisplayModes property just uses Enum.GetValues(typeof(Format)) to get the list of format values and calls the method on all of them to get the complete list. You can do this yourself, but there aren't that many of them that will be useful in practice (as you can see from the list you posted).

I wouldn't assume anything about the information returned though. Adapters can be picky, and it could work on your card when you test it but fail on an end user's computer after you distribute. Direct3D 9 adapter enumeration and set up can be quite complex and tedious, but there are plenty of examples out there on how to do it properly and it should be easy to port them to SlimDX (generally, moving from DirectX to SlimDX is easier than from MDX, but your mileage may vary).

Share this post

Link to post
Share on other sites
Cheers Mike! Yeah, I just ended up using the X8R8G8B8 pixel format for now. Doesn't really matter at this point.

I indeed noticed that I shouldn't assume anything. I tried the method on my other computer and some resolutions supported 59, 60 and 75 while some only supported 60 and so on.

Anyway, thanks for your help!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!