Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  

get screen size function

This topic is 4138 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);

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
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.

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!