diff options
Diffstat (limited to 'client/x11/platform.cpp')
-rw-r--r-- | client/x11/platform.cpp | 18 |
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) { |