Jump to content
  • Advertisement
Sign in to follow this  

Screen Resolution in Win32

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

I am developing a tool whose window can be resized. In order to keep from having to reset the D3D device I was thinking I would set the back buffer size to be the screen resolution so that there would be plenty of room to resize the window, and then just update the viewport upon resizing. The problem is, when I initialize the device and specify the back buffer size in the D3DPRESENT_PARAMETERS, I can't find a way to get the current screen resolution in Win32 to initialize the back buffer. Anyone know how to do this? Thanks

Share this post


Link to post
Share on other sites
Advertisement
As an alternative to MJP's solution, if you want to retrieve this prior to creating your IDirect3D9 object, you can use GetSystemMetrics() from the Win32 API like follows:


#include <windows.h>

int main()
{
int x=GetSystemMetrics(SM_CXSCREEN);
int y=GetSystemMetrics(SM_CYSCREEN);
}


HTH

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!