summaryrefslogtreecommitdiffstats
path: root/client/x11/platform.cpp
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-06-21 14:17:29 +0200
committerAlexander Larsson <alexl@redhat.com>2010-06-21 14:50:18 +0200
commitcfc1e95bda0e150b3de225c3572bb1004dad070e (patch)
treee672e2607613ac012f0cfe3414a33b129bae52b2 /client/x11/platform.cpp
parentae4436215cb113a02eac73c6afd368166090967c (diff)
downloadspice-cfc1e95bda0e150b3de225c3572bb1004dad070e.tar.gz
spice-cfc1e95bda0e150b3de225c3572bb1004dad070e.tar.xz
spice-cfc1e95bda0e150b3de225c3572bb1004dad070e.zip
Make opengl optional, disabled by default
The OpenGL renderer isn't really useful right now, its not quite up to date, its not really faster than software and it only supports a limited subset of drivers. So, lets disable it for now. Long term opengl rendering of the 2d part of spice is important if we want to combine 2d and 3d rendering (say if spice adds opengl support in the protocol). But until then this is isn't useful for normal use.
Diffstat (limited to 'client/x11/platform.cpp')
-rw-r--r--client/x11/platform.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index fecfb138..92264546 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -69,7 +69,9 @@ static Display* x_display = NULL;
static bool x_shm_avail = false;
static XVisualInfo **vinfo = NULL;
static RedDrawable::Format *screen_format = NULL;
+#ifdef USE_OGL
static GLXFBConfig **fb_config = NULL;
+#endif // USE_OGL
static XIM x_input_method = NULL;
static XIC x_input_context = NULL;
@@ -324,10 +326,12 @@ RedDrawable::Format XPlatform::get_screen_format(int screen)
return screen_format[screen];
}
+#ifdef USE_OGL
GLXFBConfig** XPlatform::get_fbconfig()
{
return fb_config;
}
+#endif // USE_OGL
XIC XPlatform::get_input_context()
{
@@ -2136,6 +2140,7 @@ static void cleanup(void)
delete vinfo;
vinfo = NULL;
}
+#ifdef USE_OGL
if (fb_config) {
for (i = 0; i < ScreenCount(x_display); ++i) {
if (fb_config[i]) {
@@ -2145,6 +2150,7 @@ static void cleanup(void)
delete fb_config;
fb_config = NULL;
}
+#endif // USE_OGL
}
static void quit_handler(int sig)
@@ -2291,7 +2297,9 @@ static XVisualInfo* get_x_vis_info(int screen)
void Platform::init()
{
+#ifdef USE_OGL
int err, ev;
+#endif // USE_OGL
int threads_enable;
int major, minor;
Bool pixmaps;
@@ -2314,10 +2322,11 @@ void Platform::init()
vinfo = new XVisualInfo *[ScreenCount(x_display)];
memset(vinfo, 0, sizeof(XVisualInfo *) * ScreenCount(x_display));
- fb_config = new GLXFBConfig *[ScreenCount(x_display)];
- memset(fb_config, 0, sizeof(GLXFBConfig *) * ScreenCount(x_display));
screen_format = new RedDrawable::Format[ScreenCount(x_display)];
memset(screen_format, 0, sizeof(RedDrawable::Format) * ScreenCount(x_display));
+#ifdef USE_OGL
+ fb_config = new GLXFBConfig *[ScreenCount(x_display)];
+ memset(fb_config, 0, sizeof(GLXFBConfig *) * ScreenCount(x_display));
if (threads_enable && glXQueryExtension(x_display, &err, &ev)) {
int num_configs;
@@ -2349,11 +2358,14 @@ void Platform::init()
vinfo[i] = get_x_vis_info(i);
}
}
- } else {
+ } else
+#else // !USE_OGL
+ {
for (int i = 0; i < ScreenCount(x_display); ++i) {
vinfo[i] = get_x_vis_info(i);
}
}
+#endif // USE_OGL
for (int i = 0; i < ScreenCount(x_display); ++i) {
if (vinfo[i] == NULL) {