dwscr/displayinfo.cc
josh 68d41e9c63 moved files to trunk directory
git-svn-id: svn://anubis/dwscr/trunk@83 5bef9df8-b654-44bb-925b-0ff18baa8f8c
2008-09-22 17:27:40 +00:00

31 lines
568 B
C++

/* Author: Josh Holtrop
* DornerWorks screensaver
*/
#include <stdio.h>
#include "displayinfo.h"
#include <X11/Xlib.h>
void getDisplaySize(int * width, int * height)
{
Display * display;
if ((display = XOpenDisplay(NULL)) == NULL)
{
/* fall back on hard-coded defaults */
*width = 1600;
*height = 1200;
}
else
{
int screen_num = DefaultScreen(display);
*width = DisplayWidth(display, screen_num);
*height = DisplayHeight(display, screen_num);
}
}
int getNumMonitors()
{
return 1;
}