1 Replies - 1837 Views - Last Post: 12 September 2012 - 08:31 PM Rate Topic: -----

#1 m-e-g-a-z   User is offline

  • Winning
  • member icon


Reputation: 497
  • View blog
  • Posts: 1,457
  • Joined: 19-October 09

X11 - Find out number of screens connected and GPU Information.

Posted 06 January 2011 - 05:54 AM

Description: Prints the amount of screens connected to a dsiplay.
/* screenno - prints the number of screens connected to the current display
 */

#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>

int main(int argc, char *argv[]) {
        Display * display;
        char * displayName;
        int screenNo = 0;

        displayName = getenv("DISPLAY");
        display = XOpenDisplay(displayName);
        screenNo = ScreenCount(display);

        printf("%d", screenNo);

        XCloseDisplay(display);

        return 0;
}




Is This A Good Question/Topic? 0
  • +

Replies To: X11 - Find out number of screens connected and GPU Information.

#2 aloneprogrammer   User is offline

  • New D.I.C Head

Reputation: -13
  • View blog
  • Posts: 31
  • Joined: 22-December 10

Re: X11 - Find out number of screens connected and GPU Information.

Posted 12 September 2012 - 08:31 PM

Is this snippet is for linux?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1