Jump to content
  • Advertisement
Sign in to follow this  
owl

Getting the resolutions the monitor supports (Windows API)

This topic is 4468 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

Using the windows API. Hello. Does anybody knows how to get the resolutions the monitor can handle? I belive that querying the video modes width EnumDisplaySettings returns the video modes of the video card, but I would like to filter them according to what the monitor can actually display. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
ahem. :)

Actually, what I need is the maximun refresh rate the monitor can do.

Thanks.

Share this post


Link to post
Share on other sites
Is there any reason why the dmDisplayFrequency field in the DEVMODE structure won't give you what you're looking for?

Share this post


Link to post
Share on other sites
It only returns the frequencies that the video card can do.

For example, it gives me 640x480x32 at 140hz. And my monitor can't do 140hz, not even in 320x200.

From what I've seen, many people hacks a lower and a higher limit for the refresh rate in the source code. But that's kinda nasty. You can hide the modes the monitor doesn't support in the display configuration, so, maybe, there is a way to doit through the API.

If there is one, I guess it's only supported in win2000/xp.

Anyway, if anybody knows about this, please give me a hint. Tnx.

Share this post


Link to post
Share on other sites
Perhaps you should be using EnumDisplayModesEx() and set dwFlags to 0? If that doesnt work then maybe you could first get all the display modes and then use ChangeDisplaySettings() with the CDS_TEST flag for each to see if it's valid.

Note - I've never done this before but this method seems to make sense in my head [smile]

Share this post


Link to post
Share on other sites
I'm going to try that. When you say "valid" what kind of validity are we talking about? I guess the OS should ask the monitor driver about what frequencies it support. I'll see if I can google something on what you hinted me.

tnx!

Share this post


Link to post
Share on other sites
I believe you'll get only the video modes both the video card and the monitor can display if you install drivers for the monitor.

Otherwise there is no way for the OS to know what the monitor can display.

Share this post


Link to post
Share on other sites
Quote:
Original post by izhbq412
... if you install drivers for the monitor.


Good Point! :)

I think I'm running the proper drivers because in the display configuration the modes I get with EnumDisplaySettings are hidden, as not supported. But not really that sure I am...

Share this post


Link to post
Share on other sites
Quote:
Original post by owl
I'm going to try that. When you say "valid" what kind of validity are we talking about?

By valid, I mean that when you call ChangeDisplaySettings() using CDS_TEST it doesnt tell you that the mode is unsupported.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!