if "arch!=win32"
{
require "xlib";
- build_info
- {
- library "Xxf86vm";
- };
};
if "arch=win32"
{
require "opengl";
};
+ feature "xf86vidmode" "Include support for video mode switching with xf86vidmode (not win32)";
+ if "with_xf86vidmode and arch!=win32"
+ {
+ build_info
+ {
+ library "Xxf86vm";
+ };
+ };
+
headers "gbase"
{
source "source/gbase";
#include <iostream>
#ifndef WIN32
#include <X11/Xlib.h>
+#ifdef WITH_XF86VIDMODE
#include <X11/extensions/xf86vmode.h>
#endif
+#endif
#include <msp/core/except.h>
#include <msp/strings/formatter.h>
#include <msp/strings/lexicalcast.h>
XSetErrorHandler(x_error_handler);
+#ifdef WITH_XF86VIDMODE
int screen=DefaultScreen(priv->display);
int nmodes;
if(modeline.htotal && modeline.vtotal)
orig_mode.rate=dotclock/(modeline.htotal*modeline.vtotal);
#endif
+#endif
}
Display::~Display()
void Display::set_mode(const VideoMode &mode)
{
-#ifdef WIN32
+#if defined(WIN32)
DEVMODE info;
info.dmSize=sizeof(DEVMODE);
info.dmFields=DM_PELSWIDTH|DM_PELSHEIGHT;
}
ChangeDisplaySettings(&info, CDS_FULLSCREEN);
-#else
+#elif defined(WITH_XF86VIDMODE)
int screen=DefaultScreen(priv->display);
int nmodes;
}
throw InvalidParameterValue("Requested mode not supported");
+#else
+ (void)mode;
+ throw Exception("Video mode switching not supported");
#endif
}
throw Exception("Not a PNG image and DevIL support not compiled in");
#endif
}
+ (void)fn;
}
void Image::load_memory(const void *data, unsigned size)
throw Exception("Error loading image from memory");
#else
throw Exception("Not a PNG image and DevIL support not compiled in");
- //(void)data; (void)size;
#endif
}
+ (void)data;
+ (void)size;
}
PixelFormat Image::get_format() const
{
#ifdef WITH_LIBPNG
if(priv->data)
- return priv->width;
+ return priv->height;
#endif
#ifdef WITH_DEVIL
if(priv->id)