Jump to content
  • Advertisement
Sign in to follow this  
vurentjie

get screen size function

This topic is 3767 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 want to write a small function that will detect the user's screen size, i have done a bit of research on the topic for windows it is a pretty simple call to GetSystemMetrics, i looked at Xlib calls, and these seem not to difficult either,something like
Display *display_name;

display_name = XOpenDisplay(NULL);

             DisplayWidth(display_name,screen),
             DisplayHeight(display_name,screen));
i am trying to find out more about the mac system, if anybody has information on this, it would be appreciated. I will continue googling, but thought I would drop a post here, hopefully somebody could provide me some advice. I don't own a mac myself, but can test on a friends. I think I should be looking at the Carbon API, but is this all? this last question sounds a bit duh?!? anyway advice appreciated.

Share this post


Link to post
Share on other sites
Advertisement
ok i did a bit of research on web, and i think what should be done is this....


Rect outAvailableRect;

GetAvailableWindowPositioningBounds ( GetMainDevice(), &outAvailableRect);

screenwidth = outAvailableRect.right - outAvailableRect.left;
screenheight = outAvailableRect.bottom - outAvailableRect.top;


is this more or less correct way to go about it?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!