X-Windows current resolution code

This was SVN commit r149.
This commit is contained in:
Simon Brenner 2004-01-20 02:28:54 +00:00
parent 6b5894f54c
commit 46b7ae429f

View File

@ -36,6 +36,9 @@
#include "ogl.h"
#include "wsdl.h"
#ifdef HAVE_X_WINDOWS
#include <Xlib.h>
#endif
// useful for choosing a video mode. not called by detect().
// currently not implemented for non-Win32 systems (returns 800x600).
@ -51,6 +54,16 @@ void get_cur_resolution(int& xres, int& yres)
xres = dm.dmPelsWidth;
yres = dm.dmPelsHeight;
#endif
#ifdef HAVE_X_WINDOWS
Display *disp=XOpenDisplay(NULL);
if (disp)
{
int screen=XDefaultScreen(disp);
xres=XDisplayWidth(disp, screen);
yres=XDisplayHeight(disp, screen);
XCloseDisplay(disp);
}
#endif
}