From cfc1e95bda0e150b3de225c3572bb1004dad070e Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 21 Jun 2010 14:17:29 +0200 Subject: 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. --- client/x11/platform.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'client/x11/platform.cpp') 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) { -- cgit