CreateContext(Display * dpy, XVisualInfo * vis,
const __GLcontextModes * const fbconfig,
GLXContext shareList,
- Bool allowDirect, GLXContextID contextID,
+ Bool allowDirect,
unsigned code, int renderType, int screen)
{
GLXContext gc;
if (!gc)
return NULL;
- if (None == contextID) {
if ((vis == NULL) && (fbconfig == NULL))
return NULL;
UnlockDisplay(dpy);
SyncHandle();
gc->imported = GL_FALSE;
- }
- else {
- gc->xid = contextID;
- gc->imported = GL_TRUE;
- }
gc->renderType = renderType;
glXCreateContext(Display * dpy, XVisualInfo * vis,
GLXContext shareList, Bool allowDirect)
{
- return CreateContext(dpy, vis, NULL, shareList, allowDirect, None,
+ return CreateContext(dpy, vis, NULL, shareList, allowDirect,
X_GLXCreateContext, 0, vis->screen);
}
return NULL;
}
- /* FIXME: Why does this call CreateContext? There is no protocol sent for
- * FIXME: this function.
- */
- ctx = CreateContext(dpy, NULL, NULL, NULL, False, contextID,
- X_GLXCreateContext, 0, 0);
+ ctx = AllocateGLXContext(dpy);
if (NULL != ctx) {
+ ctx->xid = contextID;
+ ctx->imported = GL_TRUE;
+
if (Success != __glXQueryContextInfo(dpy, ctx)) {
- return NULL;
+ __glXFreeContext(ctx);
+ ctx = NULL;
}
}
return ctx;
(const __GLcontextModes *const) config;
return CreateContext(dpy, NULL, fbconfig, shareList,
- allowDirect, None, X_GLXCreateNewContext, renderType,
+ allowDirect, X_GLXCreateNewContext, renderType,
fbconfig->screen);
}
if ((psc != NULL)
&& __glXExtensionBitIsEnabled(psc, SGIX_fbconfig_bit)) {
gc = CreateContext(dpy, NULL, (__GLcontextModes *) config, shareList,
- allowDirect, None,
+ allowDirect,
X_GLXvop_CreateContextWithConfigSGIX, renderType,
fbconfig->screen);
}