struct dri2_context
{
struct glx_context base;
- __GLXDRIcontext dri_vtable;
__DRIcontext *driContext;
};
}
static Bool
-dri2BindContext(struct glx_context *context,
- __GLXDRIdrawable *draw, __GLXDRIdrawable *read)
+dri2_bind_context(struct glx_context *context, struct glx_context *old,
+ GLXDrawable draw, GLXDrawable read)
{
struct dri2_context *pcp = (struct dri2_context *) context;
struct dri2_screen *psc = (struct dri2_screen *) pcp->base.psc;
- struct dri2_drawable *pdr = (struct dri2_drawable *) draw;
- struct dri2_drawable *prd = (struct dri2_drawable *) read;
+ struct dri2_drawable *pdraw, *pread;
- return (*psc->core->bindContext) (pcp->driContext,
- pdr->driDrawable, prd->driDrawable);
+ pdraw = (struct dri2_drawable *) driFetchDrawable(context, draw);
+ pread = (struct dri2_drawable *) driFetchDrawable(context, read);
+
+ if (pdraw == NULL || pread == NULL)
+ return GLXBadDrawable;
+
+ if ((*psc->core->bindContext) (pcp->driContext,
+ pdraw->driDrawable, pread->driDrawable))
+ return Success;
+
+ return GLXBadContext;
}
static void
-dri2UnbindContext(struct glx_context *context)
+dri2_unbind_context(struct glx_context *context, struct glx_context *new)
{
struct dri2_context *pcp = (struct dri2_context *) context;
struct dri2_screen *psc = (struct dri2_screen *) pcp->base.psc;
}
pcp->base.vtable = &dri2_context_vtable;
- pcp->base.driContext = &pcp->dri_vtable;
- pcp->dri_vtable.bindContext = dri2BindContext;
- pcp->dri_vtable.unbindContext = dri2UnbindContext;
return &pcp->base;
}
static const struct glx_context_vtable dri2_context_vtable = {
dri2_destroy_context,
+ dri2_bind_context,
+ dri2_unbind_context,
dri2_wait_gl,
dri2_wait_x,
DRI_glXUseXFont,
free(configs);
}
+_X_HIDDEN __GLXDRIdrawable *
+driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable)
+{
+ struct glx_display *const priv = __glXInitialize(gc->psc->dpy);
+ __GLXDRIdrawable *pdraw;
+ struct glx_screen *psc;
+
+ if (priv == NULL)
+ return NULL;
+
+ psc = priv->screens[gc->screen];
+ if (priv->drawHash == NULL)
+ return NULL;
+
+ if (__glxHashLookup(priv->drawHash, glxDrawable, (void *) &pdraw) == 0)
+ return pdraw;
+
+ pdraw = psc->driScreen->createDrawable(psc, glxDrawable,
+ glxDrawable, gc->config);
+ if (__glxHashInsert(priv->drawHash, glxDrawable, pdraw)) {
+ (*pdraw->destroyDrawable) (pdraw);
+ return NULL;
+ }
+
+ return pdraw;
+}
+
#endif /* GLX_DIRECT_RENDERING */
extern void driDestroyConfigs(const __DRIconfig **configs);
+extern __GLXDRIdrawable *
+driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable);
+
extern const __DRIsystemTimeExtension systemTimeExtension;
extern void InfoMessageF(const char *f, ...);
struct dri_context
{
struct glx_context base;
- __GLXDRIcontext dri_vtable;
__DRIcontext *driContext;
XID hwContextID;
};
Xfree(pcp);
}
-static Bool
-driBindContext(struct glx_context *context,
- __GLXDRIdrawable *draw, __GLXDRIdrawable *read)
+static int
+dri_bind_context(struct glx_context *context, struct glx_context *old,
+ GLXDrawable draw, GLXDrawable read)
{
struct dri_context *pcp = (struct dri_context *) context;
struct dri_screen *psc = (struct dri_screen *) pcp->base.psc;
- struct dri_drawable *pdr = (struct dri_drawable *) draw;
- struct dri_drawable *prd = (struct dri_drawable *) read;
+ struct dri_drawable *pdraw, *pread;
+
+ pdraw = (struct dri_drawable *) driFetchDrawable(context, draw);
+ pread = (struct dri_drawable *) driFetchDrawable(context, read);
+
+ if (pdraw == NULL || pread == NULL)
+ return GLXBadDrawable;
- return (*psc->core->bindContext) (pcp->driContext,
- pdr->driDrawable, prd->driDrawable);
+ if ((*psc->core->bindContext) (pcp->driContext,
+ pdraw->driDrawable, pread->driDrawable))
+ return Success;
+
+ return GLXBadContext;
}
static void
-driUnbindContext(struct glx_context * context)
+dri_unbind_context(struct glx_context *context, struct glx_context *new)
{
struct dri_context *pcp = (struct dri_context *) context;
struct dri_screen *psc = (struct dri_screen *) pcp->base.psc;
static const struct glx_context_vtable dri_context_vtable = {
dri_destroy_context,
+ dri_bind_context,
+ dri_unbind_context,
NULL,
NULL,
DRI_glXUseXFont,
return NULL;
if (shareList) {
- pcp_shared = (struct dri_context *) shareList->driContext;
+ pcp_shared = (struct dri_context *) shareList;
shared = pcp_shared->driContext;
}
}
pcp->base.vtable = &dri_context_vtable;
- pcp->base.driContext = &pcp->dri_vtable;
- pcp->dri_vtable.bindContext = driBindContext;
- pcp->dri_vtable.unbindContext = driUnbindContext;
return &pcp->base;
}
static int
driSetSwapInterval(__GLXDRIdrawable *pdraw, int interval)
{
- struct glx_context *gc = __glXGetCurrentContext();
struct dri_drawable *pdp = (struct dri_drawable *) pdraw;
- struct dri_screen *psc;
-
- if (gc->driContext) {
- psc = (struct dri_screen *) pdraw->psc;
+ struct dri_screen *psc = (struct dri_screen *) pdraw->psc;
- if (psc->swapControl != NULL && pdraw != NULL) {
- psc->swapControl->setSwapInterval(pdp->driDrawable, interval);
- return 0;
- }
+ if (psc->swapControl != NULL && pdraw != NULL) {
+ psc->swapControl->setSwapInterval(pdp->driDrawable, interval);
+ return 0;
}
return GLX_BAD_CONTEXT;
static int
driGetSwapInterval(__GLXDRIdrawable *pdraw)
{
- struct glx_context *gc = __glXGetCurrentContext();
struct dri_drawable *pdp = (struct dri_drawable *) pdraw;
- struct dri_screen *psc;
-
- if (gc != NULL && gc->driContext) {
- psc = (struct dri_screen *) pdraw->psc;
+ struct dri_screen *psc = (struct dri_screen *) pdraw->psc;
- if (psc->swapControl != NULL && pdraw != NULL) {
- return psc->swapControl->getSwapInterval(pdp->driDrawable);
- }
- }
+ if (psc->swapControl != NULL && pdraw != NULL)
+ return psc->swapControl->getSwapInterval(pdp->driDrawable);
return 0;
}
struct drisw_context
{
struct glx_context base;
- __GLXDRIcontext dri_vtable;
__DRIcontext *driContext;
};
Xfree(pcp);
}
-static Bool
-driBindContext(struct glx_context * context,
- __GLXDRIdrawable * draw, __GLXDRIdrawable * read)
+static int
+drisw_bind_context(struct glx_context *context, struct glx_context *old,
+ GLXDrawable draw, GLXDrawable read)
{
struct drisw_context *pcp = (struct drisw_context *) context;
struct drisw_screen *psc = (struct drisw_screen *) pcp->base.psc;
- struct drisw_drawable *pdr = (struct drisw_drawable *) draw;
- struct drisw_drawable *prd = (struct drisw_drawable *) read;
+ struct drisw_drawable *pdraw, *pread;
+
+ pdraw = (struct drisw_drawable *) driFetchDrawable(context, draw);
+ pread = (struct drisw_drawable *) driFetchDrawable(context, read);
+
+ if (pdraw == NULL || pread == NULL)
+ return GLXBadDrawable;
+
+ if ((*psc->core->bindContext) (pcp->driContext,
+ pdraw->driDrawable, pread->driDrawable))
+ return Success;
- return (*psc->core->bindContext) (pcp->driContext,
- pdr->driDrawable, prd->driDrawable);
+ return GLXBadContext;
}
static void
-driUnbindContext(struct glx_context * context)
+drisw_unbind_context(struct glx_context *context, struct glx_context *new)
{
struct drisw_context *pcp = (struct drisw_context *) context;
struct drisw_screen *psc = (struct drisw_screen *) pcp->base.psc;
static const struct glx_context_vtable drisw_context_vtable = {
drisw_destroy_context,
+ drisw_bind_context,
+ drisw_unbind_context,
NULL,
NULL,
DRI_glXUseXFont,
return NULL;
if (shareList) {
- pcp_shared = (struct drisw_context *) shareList->driContext;
+ pcp_shared = (struct drisw_context *) shareList;
shared = pcp_shared->driContext;
}
}
pcp->base.vtable = &drisw_context_vtable;
- pcp->base.driContext = &pcp->dri_vtable;
- pcp->dri_vtable.bindContext = driBindContext;
- pcp->dri_vtable.unbindContext = driUnbindContext;
return &pcp->base;
}
typedef struct __GLXDRIdisplayRec __GLXDRIdisplay;
typedef struct __GLXDRIscreenRec __GLXDRIscreen;
typedef struct __GLXDRIdrawableRec __GLXDRIdrawable;
-typedef struct __GLXDRIcontextRec __GLXDRIcontext;
#include "glxextensions.h"
int (*getSwapInterval)(__GLXDRIdrawable *pdraw);
};
-struct __GLXDRIcontextRec
-{
- Bool(*bindContext) (struct glx_context *context, __GLXDRIdrawable *pdraw,
- __GLXDRIdrawable *pread);
- void (*unbindContext) (struct glx_context *context);
-};
-
struct __GLXDRIdrawableRec
{
void (*destroyDrawable) (__GLXDRIdrawable * drawable);
struct glx_context_vtable {
void (*destroy)(struct glx_context *ctx);
+ int (*bind)(struct glx_context *context, struct glx_context *old,
+ GLXDrawable draw, GLXDrawable read);
+ void (*unbind)(struct glx_context *context, struct glx_context *new);
void (*wait_gl)(struct glx_context *ctx);
void (*wait_x)(struct glx_context *ctx);
void (*use_x_font)(struct glx_context *ctx,
*/
struct glx_config *config;
-#ifdef GLX_DIRECT_RENDERING
-#ifdef GLX_USE_APPLEGL
- void *driContext;
- Bool do_destroy;
-#else
- __GLXDRIcontext *driContext;
-#endif
-#endif
-
/**
* The current read-drawable for this context. Will be None if this
* context is not current to any drawable.
extern struct glx_screen *
indirect_create_screen(int screen, struct glx_display * priv);
+extern int
+indirect_bind_context(struct glx_context *gc, struct glx_context *old,
+ GLXDrawable draw, GLXDrawable read);
+extern void
+indirect_unbind_context(struct glx_context *gc, struct glx_context *new);
#endif /* !__GLX_client_h__ */
#include "apple_glx_context.h"
#include "apple_glx.h"
#include "glx_error.h"
-#define GC_IS_DIRECT(gc) ((gc)->isDirect)
#else
#include <sys/time.h>
#include <X11/extensions/xf86vmode.h>
#include "xf86dri.h"
-#define GC_IS_DIRECT(gc) ((gc)->driContext != NULL)
#endif
#else
-#define GC_IS_DIRECT(gc) (0)
#endif
#if defined(USE_XCB)
gc->psc = psc;
gc->config = config;
gc->isDirect = GL_TRUE;
+ gc->currentContextTag = -1;
return GL_TRUE;
}
req->visual = generic_id;
req->screen = screen;
req->shareList = shareList ? shareList->xid : None;
- req->isDirect = GC_IS_DIRECT(gc);
+ req->isDirect = gc->isDirect;
break;
}
req->screen = screen;
req->renderType = renderType;
req->shareList = shareList ? shareList->xid : None;
- req->isDirect = GC_IS_DIRECT(gc);
+ req->isDirect = gc->isDirect;
break;
}
req->screen = screen;
req->renderType = renderType;
req->shareList = shareList ? shareList->xid : None;
- req->isDirect = GC_IS_DIRECT(gc);
+ req->isDirect = gc->isDirect;
break;
}
}
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
/* NOT_DONE: This does not work yet */
}
#endif
if (!gc) {
return GL_FALSE;
}
- else if (GC_IS_DIRECT(gc)) {
+ else if (gc->isDirect) {
return GL_TRUE;
}
#ifdef GLX_USE_APPLEGL /* TODO: indirect on darwin */
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
#ifdef GLX_DIRECT_RENDERING
- if (gc->driContext && psc->driScreen && psc->driScreen->setSwapInterval) {
+ if (gc->isDirect && psc->driScreen && psc->driScreen->setSwapInterval) {
__GLXDRIdrawable *pdraw =
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
psc->driScreen->setSwapInterval(pdraw, interval);
#ifdef GLX_DIRECT_RENDERING
struct glx_context *gc = __glXGetCurrentContext();
- if (gc != NULL && gc->driContext) {
+ if (gc != NULL && gc->isDirect) {
struct glx_screen *psc;
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
#ifdef GLX_DIRECT_RENDERING
struct glx_context *gc = __glXGetCurrentContext();
- if (gc != NULL && gc->driContext) {
+ if (gc != NULL && gc->isDirect) {
struct glx_screen *psc;
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
return GLX_BAD_CONTEXT;
#ifdef GLX_DIRECT_RENDERING
- if (!gc->driContext)
+ if (!gc->isDirect)
return GLX_BAD_CONTEXT;
#endif
return GLX_BAD_CONTEXT;
#ifdef GLX_DIRECT_RENDERING
- if (!gc->driContext)
+ if (!gc->isDirect)
return GLX_BAD_CONTEXT;
#endif
return -1;
#ifdef GLX_DIRECT_RENDERING
- if (!pdraw || !gc->driContext)
+ if (!pdraw || !gc->isDirect)
return -1;
#endif
static const struct glx_context_vtable indirect_context_vtable = {
indirect_destroy_context,
+ indirect_bind_context,
+ indirect_unbind_context,
indirect_wait_gl,
indirect_wait_x,
indirect_use_x_font,
return ret;
}
-
-#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
-static __GLXDRIdrawable *
-FetchDRIDrawable(Display * dpy,
- GLXDrawable glxDrawable, struct glx_context *gc)
-{
- struct glx_display *const priv = __glXInitialize(dpy);
- __GLXDRIdrawable *pdraw;
- struct glx_screen *psc;
-
- if (priv == NULL)
- return NULL;
-
- psc = priv->screens[gc->screen];
- if (priv->drawHash == NULL)
- return NULL;
-
- if (__glxHashLookup(priv->drawHash, glxDrawable, (void *) &pdraw) == 0)
- return pdraw;
-
- pdraw = psc->driScreen->createDrawable(psc, glxDrawable,
- glxDrawable, gc->config);
- if (__glxHashInsert(priv->drawHash, glxDrawable, pdraw)) {
- (*pdraw->destroyDrawable) (pdraw);
- return NULL;
- }
-
- return pdraw;
-}
-#endif /* GLX_DIRECT_RENDERING */
-
static void
__glXGenerateError(Display * dpy, struct glx_context *gc, XID resource,
BYTE errorCode, CARD16 minorCode)
#endif /* GLX_USE_APPLEGL */
+_X_HIDDEN int
+indirect_bind_context(struct glx_context *gc, struct glx_context *old,
+ GLXDrawable draw, GLXDrawable read)
+{
+ xGLXMakeCurrentReply reply;
+ GLXContextTag tag;
+ __GLXattribute *state;
+ Display *dpy = gc->psc->dpy;
+ int opcode = __glXSetupForCommand(dpy);
+
+ if (old && !old->isDirect && old->psc->dpy == dpy)
+ tag = old->currentContextTag;
+ else
+ tag = None;
+
+ SendMakeCurrentRequest(dpy, opcode, gc->xid, tag, draw, read, &reply);
+
+ if (!IndirectAPI)
+ IndirectAPI = __glXNewIndirectAPI();
+ _glapi_set_dispatch(IndirectAPI);
+
+ gc->currentContextTag = reply.contextTag;
+ state = gc->client_state_private;
+ if (state->array_state == NULL) {
+ glGetString(GL_EXTENSIONS);
+ glGetString(GL_VERSION);
+ __glXInitVertexArrayState(gc);
+ }
+
+ return Success;
+}
+
+_X_HIDDEN void
+indirect_unbind_context(struct glx_context *gc, struct glx_context *new)
+{
+ Display *dpy = gc->psc->dpy;
+ int opcode = __glXSetupForCommand(dpy);
+ xGLXMakeCurrentReply reply;
+
+ /* We are either switching to no context, away from a indirect
+ * context to a direct context or from one dpy to another and have
+ * to send a request to the dpy to unbind the previous context.
+ */
+ if (!new || new->isDirect || new->psc->dpy != dpy)
+ SendMakeCurrentRequest(dpy, opcode, None,
+ gc->currentContextTag, None, None, &reply);
+ gc->currentContextTag = 0;
+}
+
/**
* Make a particular context current.
*
{
struct glx_context *gc = (struct glx_context *) gc_user;
struct glx_context *oldGC = __glXGetCurrentContext();
-#ifdef GLX_USE_APPLEGL
- bool error = apple_glx_make_current_context(dpy,
- (oldGC && oldGC != &dummyContext) ? oldGC->driContext : NULL,
- gc ? gc->driContext : NULL, draw);
-
- apple_glx_diagnostic("%s: error %s\n", __func__, error ? "YES" : "NO");
- if(error)
- return GL_FALSE;
-#else
- xGLXMakeCurrentReply reply;
- const CARD8 opcode = __glXSetupForCommand(dpy);
- const CARD8 oldOpcode = ((gc == oldGC) || (oldGC == &dummyContext))
- ? opcode : __glXSetupForCommand(oldGC->currentDpy);
- Bool bindReturnValue;
- __GLXattribute *state;
-
- if (!opcode || !oldOpcode) {
- return GL_FALSE;
- }
+ int ret = Success;
/* Make sure that the new context has a nonzero ID. In the request,
* a zero context ID is used only to mean that we bind to no current
return False;
}
-#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- /* Bind the direct rendering context to the drawable */
- if (gc && gc->driContext) {
- __GLXDRIdrawable *pdraw = FetchDRIDrawable(dpy, draw, gc);
- __GLXDRIdrawable *pread = FetchDRIDrawable(dpy, read, gc);
-
- if ((pdraw == NULL) || (pread == NULL)) {
- __glXGenerateError(dpy, gc, (pdraw == NULL) ? draw : read,
- GLXBadDrawable, X_GLXMakeContextCurrent);
- return False;
- }
-
- bindReturnValue =
- (gc->driContext->bindContext) (gc, pdraw, pread);
+ if (oldGC != &dummyContext && oldGC != gc) {
+ oldGC->vtable->unbind(oldGC, gc);
+ oldGC->currentDpy = 0;
+ oldGC->currentDrawable = None;
+ oldGC->currentReadable = None;
+ oldGC->thread_id = 0;
+ if (oldGC->xid == None)
+ /* We are switching away from a context that was
+ * previously destroyed, so we need to free the memory
+ * for the old handle.
+ */
+ oldGC->vtable->destroy(oldGC);
}
- else if (!gc && oldGC && oldGC->driContext) {
- bindReturnValue = True;
- }
- else
-#endif
- {
- /* Send a glXMakeCurrent request to bind the new context. */
- bindReturnValue =
- SendMakeCurrentRequest(dpy, opcode, gc ? gc->xid : None,
- ((dpy != oldGC->currentDpy)
- || oldGC->isDirect)
- ? None : oldGC->currentContextTag, draw, read,
- &reply);
- }
-
- if (!bindReturnValue) {
- return False;
+ if (gc) {
+ ret = gc->vtable->bind(gc, oldGC, draw, read);
+ gc->currentDpy = dpy;
+ gc->currentDrawable = draw;
+ gc->currentReadable = read;
+ gc->thread_id = _glthread_GetID();
+ __glXSetCurrentContext(gc);
+ } else {
+ __glXSetCurrentContextNull();
}
-#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if ((dpy != oldGC->currentDpy || (gc && gc->driContext)) &&
- !oldGC->isDirect && oldGC != &dummyContext) {
-#else
- if ((dpy != oldGC->currentDpy) && oldGC != &dummyContext) {
-#endif
- xGLXMakeCurrentReply dummy_reply;
-
- /* We are either switching from one dpy to another and have to
- * send a request to the previous dpy to unbind the previous
- * context, or we are switching away from a indirect context to
- * a direct context and have to send a request to the dpy to
- * unbind the previous context.
- */
- (void) SendMakeCurrentRequest(oldGC->currentDpy, oldOpcode, None,
- oldGC->currentContextTag, None, None,
- &dummy_reply);
- }
-#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- else if (oldGC->driContext && oldGC != gc) {
- oldGC->driContext->unbindContext(oldGC);
- }
-#endif
-
-#endif /* GLX_USE_APPLEGL */
-
- /* Update our notion of what is current */
- __glXLock();
- if (gc == oldGC) {
- /* Even though the contexts are the same the drawable might have
- * changed. Note that gc cannot be the dummy, and that oldGC
- * cannot be NULL, therefore if they are the same, gc is not
- * NULL and not the dummy.
- */
- if(gc) {
- gc->currentDrawable = draw;
- gc->currentReadable = read;
- }
+ if (ret) {
+ __glXGenerateError(dpy, gc, None, ret, X_GLXMakeContextCurrent);
+ return GL_FALSE;
}
- else {
- if (oldGC != &dummyContext) {
- /* Old current context is no longer current to anybody */
- oldGC->currentDpy = 0;
- oldGC->currentDrawable = None;
- oldGC->currentReadable = None;
- oldGC->currentContextTag = 0;
- oldGC->thread_id = 0;
-
- if (oldGC->xid == None) {
- /* We are switching away from a context that was
- * previously destroyed, so we need to free the memory
- * for the old handle.
- */
- oldGC->vtable->destroy(oldGC);
- }
- }
- if (gc) {
- __glXSetCurrentContext(gc);
-
- gc->currentDpy = dpy;
- gc->currentDrawable = draw;
- gc->currentReadable = read;
-#ifndef GLX_USE_APPLEGL
- gc->thread_id = _glthread_GetID();
-#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (!gc->driContext) {
-#endif
- if (!IndirectAPI)
- IndirectAPI = __glXNewIndirectAPI();
- _glapi_set_dispatch(IndirectAPI);
-
- state = (__GLXattribute *) (gc->client_state_private);
-
- gc->currentContextTag = reply.contextTag;
- if (state->array_state == NULL) {
- (void) glGetString(GL_EXTENSIONS);
- (void) glGetString(GL_VERSION);
- __glXInitVertexArrayState(gc);
- }
-#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- }
- else {
- gc->currentContextTag = -1;
- }
-#endif
-#endif /* GLX_USE_APPLEGL */
- }
- else {
- __glXSetCurrentContextNull();
- }
- }
- __glXUnlock();
return GL_TRUE;
}
** If that works then fetch the per screen configs data.
*/
static Bool
- AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
+AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
{
struct glx_screen *psc;
GLint i, screens;
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_DeleteTextures(GET_DISPATCH(), (n, textures));
} else
#endif
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GenTextures(GET_DISPATCH(), (n, textures));
} else
#endif
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
return CALL_IsTexture(GET_DISPATCH(), (texture));
} else
#endif
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table));
} else
#endif
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetColorTableParameterfv(GET_DISPATCH(),
(target, pname, params));
} else
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetColorTableParameteriv(GET_DISPATCH(),
(target, pname, params));
} else
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetConvolutionFilter(GET_DISPATCH(),
(target, format, type, image));
} else
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetConvolutionParameterfv(GET_DISPATCH(),
(target, pname, params));
} else
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetConvolutionParameteriv(GET_DISPATCH(),
(target, pname, params));
} else
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetHistogram(GET_DISPATCH(),
(target, reset, format, type, values));
} else
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params));
} else
#endif
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params));
} else
#endif
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values));
} else
#endif
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params));
} else
#endif
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params));
} else
#endif
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- if (gc->driContext) {
+ if (gc->isDirect) {
CALL_GetSeparableFilter(GET_DISPATCH(),
(target, format, type, row, column, span));
return;
print ' struct glx_context * const gc = __glXGetCurrentContext();'
print ''
print '#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)'
- print ' if (gc->driContext) {'
+ print ' if (gc->isDirect) {'
print ' %sCALL_%s(GET_DISPATCH(), (%s));' % (ret_string, func.name, func.get_called_parameter_string())
print ' } else'
print '#endif'