Jump to content
  • Advertisement
Sign in to follow this  
Icebone1000

[Win32] How to get number of physical pixels on screen?

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

The functions getsystemmetrics( SM_CXSCREEN) and getdevcaps( HORZRES ) does NOT return the actual number of pixels on the monitor, it returns the number of pixels on the current resolution..How I get the actual number of pixels the display adapter have(the native resolution, the ones you can see if you glue your eye on the screen)?

Share this post


Link to post
Share on other sites
Advertisement
I can't find any information on retrieving the native/physical resolution, seemingly because not all monitors have a native resolution (e.g. CRT monitors).

What you could do is enumerate the available display adapters and supported display modes and presumably select the maximum supported resolution? To do this you can use the Win32 API functions EnumDisplayAdapters and EnumDisplaySettings.

I'm not sure how reliable this method is though - for example my Asus EEE netbook can have a display resolution larger than the native/physical display resolution by allowing the display to be scrolled. I don't know for sure if EnumDisplaySettings on the netbook would return resolutions larger than the physical resolution or if this is a feature supported only by the supplied software.

Share this post


Link to post
Share on other sites

I can't find any information on retrieving the native/physical resolution, seemingly because not all monitors have a native resolution (e.g. CRT monitors).

What you could do is enumerate the available display adapters and supported display modes and presumably select the maximum supported resolution? To do this you can use the Win32 API functions EnumDisplayAdapters and EnumDisplaySettings.

I'm not sure how reliable this method is though - for example my Asus EEE netbook can have a display resolution larger than the native/physical display resolution by allowing the display to be scrolled. I don't know for sure if EnumDisplaySettings on the netbook would return resolutions larger than the physical resolution or if this is a feature supported only by the supplied software.


Yeah I though about that too..

What I want to do is adjust the aspect ratio of my sprites on any screen resolution, instead of limiting the resolutions available..Not sure how well this works, but at least isnt worse then let things streched..


edit:
I just got thinking..on the nVidia control panel, it shows all supported resolution, and the native resolution have a "(native)" on its right side, so theres gotta be a way to get the info Dx

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!