From 521e4b9b7e3c79e7362f7cbd594a2e8cf74cdfe4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Sep 2009 10:24:27 -0600 Subject: [PATCH] glx: fix glXQueryContext(GLX_RENDER_TYPE) The renderType parameter to CreateContext() was never used. Also, it was often passed as zero. Now when it's zero we check if the context is RGBA or CI mode and set it accordingly. Fixes bug 24211. --- src/glx/x11/glxcmds.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index af3e559f999..cd4aede74e4 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -398,6 +398,10 @@ CreateContext(Display * dpy, XVisualInfo * vis, _XError(dpy, &error); return None; } + if (renderType == 0) { + /* Initialize renderType now */ + renderType = mode->rgbMode ? GLX_RGBA_TYPE : GLX_COLOR_INDEX_TYPE; + } } else { mode = fbconfig; @@ -484,6 +488,8 @@ CreateContext(Display * dpy, XVisualInfo * vis, gc->imported = GL_TRUE; } + gc->renderType = renderType; + return gc; } -- 2.30.2