SFML community forums

General => Feature requests => Topic started by: vurentjie on June 22, 2008, 10:26:01 pm

Title: detect display size
Post by: vurentjie on June 22, 2008, 10:26:01 pm
hi,

i was wondering if it was at all possible to include a function that will detect the screen width and height, so that windows can be automatically opened at a maximum size,

i did do a bit of research on the topic, if you do consider adding this feature this might help,


On windows:
Code: [Select]

  screenwidth = (GetSystemMetrics( SM_CXFULLSCREEN ));
  screenheight = (GetSystemMetrics( SM_CYFULLSCREEN ));


On X11:
Code: [Select]

  Display *display_name;

 display_name = XOpenDisplay(NULL);

             screenwidth = DisplayWidth(display_name,screen);
             screenheight = DisplayHeight(display_name,screen);


On mac, using carbon
Code: [Select]

   
   Rect outAvailableRect;

        GetAvailableWindowPositioningBounds ( GetMainDevice(), &outAvailableRect);

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


I am not sure if these are totally correct or if it is covers all that is needed, but please consider this.

later
vurentjie
Title: detect display size
Post by: Laurent on June 23, 2008, 03:02:15 am
sf::VideoMode::GetDesktopMode() already does that ;)
Title: detect display size
Post by: vurentjie on June 23, 2008, 08:48:20 am
great!