From 912d46817edabe8419a842e6f3d4ecc9bf09eead Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 22 Jul 2011 00:00:51 +0100 Subject: [PATCH] glx: Bail from _renderer_connect if not GL driver The GLX winsys is only compatible with GL drivers so we now bail out from cogl-winsys-glx.c:_cogl_winsys_renderer_connect if a GLES driver has been chosen. Reviewed-by: Neil Roberts --- cogl/winsys/cogl-winsys-glx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c index a092bc7a0..0a2fe00be 100644 --- a/cogl/winsys/cogl-winsys-glx.c +++ b/cogl/winsys/cogl-winsys-glx.c @@ -312,6 +312,14 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer, if (!_cogl_xlib_renderer_connect (renderer, error)) goto error; + if (renderer->driver != COGL_DRIVER_GL) + { + g_set_error (error, COGL_WINSYS_ERROR, + COGL_WINSYS_ERROR_INIT, + "GLX Backend can only be used in conjunction with OpenGL"); + goto error; + } + glx_renderer->libgl_module = g_module_open (COGL_GL_LIBNAME, G_MODULE_BIND_LAZY);