forked from 0ad/0ad
X-Windows current resolution code
This was SVN commit r149.
This commit is contained in:
parent
6b5894f54c
commit
46b7ae429f
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user