summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GL/glx/g_disptab.c44
-rw-r--r--GL/glx/g_disptab.h23
-rw-r--r--GL/glx/glxcmds.c99
-rw-r--r--GL/glx/glxcmdsswap.c76
-rw-r--r--GL/glx/glxext.h3
5 files changed, 207 insertions, 38 deletions
diff --git a/GL/glx/g_disptab.c b/GL/glx/g_disptab.c
index c41c45e9f..e97ace6ba 100644
--- a/GL/glx/g_disptab.c
+++ b/GL/glx/g_disptab.c
@@ -47,7 +47,7 @@ __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXMakeCurrent,
__glXIsDirect,
__glXQueryVersion,
- __glXWaitGL,
+ __glXWaitGL, /* 0x08 */
__glXWaitX,
__glXCopyContext,
__glXSwapBuffers,
@@ -55,23 +55,23 @@ __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXCreateGLXPixmap,
__glXGetVisualConfigs,
__glXDestroyGLXPixmap,
- __glXVendorPrivate,
+ __glXVendorPrivate, /* 0x10 */
__glXVendorPrivateWithReply,
__glXQueryExtensionsString,
__glXQueryServerString,
__glXClientInfo,
__glXGetFBConfigs,
__glXCreatePixmap,
- __glXDestroyGLXPixmap, /* glXDestroyPixmap */
- __glXCreateNewContext,
- __glXNoSuchSingleOpcode, /* glXQueryContext */
+ __glXDestroyPixmap,
+ __glXCreateNewContext, /* 0x18 */
+ __glXQueryContext,
__glXMakeContextCurrent,
- __glXNoSuchSingleOpcode, /* glXCreatePbuffer */
- __glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
- __glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
- __glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
- __glXNoSuchSingleOpcode, /* glXCreateWindow */
- __glXNoSuchSingleOpcode, /* glXDestroyWindow */
+ __glXCreatePbuffer,
+ __glXDestroyPbuffer,
+ __glXGetDrawableAttributes,
+ __glXChangeDrawableAttributes,
+ __glXCreateWindow,
+ __glXDestroyWindow, /* 0x20 */
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
@@ -448,7 +448,7 @@ __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXSwapMakeCurrent,
__glXSwapIsDirect,
__glXSwapQueryVersion,
- __glXSwapWaitGL,
+ __glXSwapWaitGL, /* 0x08 */
__glXSwapWaitX,
__glXSwapCopyContext,
__glXSwapSwapBuffers,
@@ -456,23 +456,23 @@ __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXSwapCreateGLXPixmap,
__glXSwapGetVisualConfigs,
__glXSwapDestroyGLXPixmap,
- __glXSwapVendorPrivate,
+ __glXSwapVendorPrivate, /* 0x10 */
__glXSwapVendorPrivateWithReply,
__glXSwapQueryExtensionsString,
__glXSwapQueryServerString,
__glXSwapClientInfo,
__glXSwapGetFBConfigs,
__glXSwapCreatePixmap,
- __glXSwapDestroyGLXPixmap, /* glXDestroyPixmap */
- __glXSwapCreateNewContext,
- __glXNoSuchSingleOpcode, /* glXQueryContext */
+ __glXSwapDestroyPixmap,
+ __glXSwapCreateNewContext, /* 0x18 */
+ __glXSwapQueryContext,
__glXSwapMakeContextCurrent,
- __glXNoSuchSingleOpcode, /* glXCreatePbuffer */
- __glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
- __glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
- __glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
- __glXNoSuchSingleOpcode, /* glXCreateWindow */
- __glXNoSuchSingleOpcode, /* glXDestroyWindow */
+ __glXSwapCreatePbuffer,
+ __glXSwapDestroyPbuffer,
+ __glXSwapGetDrawableAttributes,
+ __glXSwapChangeDrawableAttributes,
+ __glXSwapCreateWindow,
+ __glXSwapDestroyWindow, /* 0x20 */
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
diff --git a/GL/glx/g_disptab.h b/GL/glx/g_disptab.h
index 9ae901c1d..9be5bdf2c 100644
--- a/GL/glx/g_disptab.h
+++ b/GL/glx/g_disptab.h
@@ -60,8 +60,17 @@ extern int __glXQueryServerString(__GLXclientState*, GLbyte*);
extern int __glXClientInfo(__GLXclientState*, GLbyte*);
extern int __glXMakeContextCurrent(__GLXclientState*, GLbyte*);
extern int __glXGetFBConfigs(__GLXclientState*, GLbyte*);
-extern int __glXCreateNewContext(__GLXclientState*, GLbyte*);
extern int __glXCreatePixmap(__GLXclientState*, GLbyte*);
+extern int __glXDestroyPixmap(__GLXclientState*, GLbyte*);
+extern int __glXCreateNewContext(__GLXclientState*, GLbyte*);
+extern int __glXQueryContext(__GLXclientState*, GLbyte*);
+extern int __glXMakeContextCurrent(__GLXclientState*, GLbyte*);
+extern int __glXCreatePbuffer(__GLXclientState*, GLbyte*);
+extern int __glXDestroyPbuffer(__GLXclientState*, GLbyte*);
+extern int __glXGetDrawableAttributes(__GLXclientState*, GLbyte*);
+extern int __glXChangeDrawableAttributes(__GLXclientState*, GLbyte*);
+extern int __glXCreateWindow(__GLXclientState*, GLbyte*);
+extern int __glXDestroyWindow(__GLXclientState*, GLbyte*);
extern int __glXSwapRender(__GLXclientState*, GLbyte*);
extern int __glXSwapRenderLarge(__GLXclientState*, GLbyte*);
@@ -88,8 +97,18 @@ extern int __glXSwapQueryServerString(__GLXclientState*, GLbyte*);
extern int __glXSwapClientInfo(__GLXclientState*, GLbyte*);
extern int __glXSwapMakeContextCurrent(__GLXclientState*, GLbyte*);
extern int __glXSwapGetFBConfigs(__GLXclientState*, GLbyte*);
-extern int __glXSwapCreateNewContext(__GLXclientState*, GLbyte*);
extern int __glXSwapCreatePixmap(__GLXclientState*, GLbyte*);
+extern int __glXSwapDestroyPixmap(__GLXclientState*, GLbyte*);
+extern int __glXSwapCreateNewContext(__GLXclientState*, GLbyte*);
+extern int __glXSwapQueryContext(__GLXclientState*, GLbyte*);
+extern int __glXSwapMakeContextCurrent(__GLXclientState*, GLbyte*);
+extern int __glXSwapCreatePbuffer(__GLXclientState*, GLbyte*);
+extern int __glXSwapDestroyPbuffer(__GLXclientState*, GLbyte*);
+extern int __glXSwapGetDrawableAttributes(__GLXclientState*, GLbyte*);
+extern int __glXSwapChangeDrawableAttributes(__GLXclientState*, GLbyte*);
+extern int __glXSwapCreateWindow(__GLXclientState*, GLbyte*);
+extern int __glXSwapDestroyWindow(__GLXclientState*, GLbyte*);
+
#define __GLX_MIN_GLXCMD_OPCODE 1
#define __GLX_MAX_GLXCMD_OPCODE 20
diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c
index 79fee207a..e2e157db8 100644
--- a/GL/glx/glxcmds.c
+++ b/GL/glx/glxcmds.c
@@ -1299,16 +1299,9 @@ int __glXCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
}
-/**
- * Destroy a GLX pixmap. This function is used for both
- * \c glXDestroyGLXPixmap and \c glXDestroyPixmap.
- */
-
-int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+int DoDestroyPixmap(__GLXclientState *cl, XID glxpixmap)
{
ClientPtr client = cl->client;
- xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
- XID glxpixmap = req->glxpixmap;
/*
** Check if it's a valid GLX pixmap.
@@ -1318,9 +1311,71 @@ int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
return __glXBadPixmap;
}
FreeResource(glxpixmap, FALSE);
+
return Success;
}
+int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
+
+ return DoDestroyPixmap(cl, req->glxpixmap);
+}
+
+int __glXDestroyPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXDestroyPixmapReq *req = (xGLXDestroyPixmapReq *) pc;
+
+ return DoDestroyPixmap(cl, req->glxpixmap);
+}
+
+int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
+
+ (void) req;
+
+ return BadRequest;
+}
+
+int __glXDestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
+
+ (void) req;
+
+ return BadRequest;
+}
+
+int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXChangeDrawableAttributesReq *req =
+ (xGLXChangeDrawableAttributesReq *) pc;
+
+ (void) req;
+
+ return BadRequest;
+}
+
+int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
+
+ (void) req;
+
+ return BadRequest;
+}
+
+int __glXDestroyWindow(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
+
+ (void) req;
+
+ return BadRequest;
+}
+
+
/*****************************************************************************/
/*
@@ -1419,20 +1474,18 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
}
-int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
+int DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
{
ClientPtr client = cl->client;
__GLXcontext *ctx;
- xGLXQueryContextInfoEXTReq *req;
xGLXQueryContextInfoEXTReply reply;
int nProps;
int *sendBuf, *pSendBuf;
int nReplyBytes;
- req = (xGLXQueryContextInfoEXTReq *)pc;
- ctx = (__GLXcontext *) LookupIDByType(req->context, __glXContextRes);
+ ctx = (__GLXcontext *) LookupIDByType(gcId, __glXContextRes);
if (!ctx) {
- client->errorValue = req->context;
+ client->errorValue = gcId;
return __glXBadContext;
}
@@ -1466,6 +1519,19 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
return Success;
}
+int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
+
+ return DoQueryContext(cl, req->context);
+}
+
+int __glXQueryContext(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
+
+ return DoQueryContext(cl, req->context);
+}
int __glXBindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
{
@@ -1589,6 +1655,13 @@ int __glXGetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
return DoGetDrawableAttributes(cl, drawable);
}
+int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc;
+
+ return DoGetDrawableAttributes(cl, req->drawable);
+}
+
/************************************************************************/
/*
diff --git a/GL/glx/glxcmdsswap.c b/GL/glx/glxcmdsswap.c
index 0f8b67496..3464e135a 100644
--- a/GL/glx/glxcmdsswap.c
+++ b/GL/glx/glxcmdsswap.c
@@ -315,6 +315,68 @@ int __glXSwapDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
return __glXDestroyGLXPixmap(cl, pc);
}
+int __glXSwapDestroyPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->glxpixmap);
+
+ return __glXDestroyGLXPixmap(cl, pc);
+}
+
+int __glXSwapQueryContext(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
+
+ (void) req;
+
+ return BadRequest;
+}
+
+int __glXSwapCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
+
+ (void) req;
+
+ return BadRequest;
+}
+
+int __glXSwapDestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) req;
+
+ return BadRequest;
+}
+
+int __glXSwapChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXChangeDrawableAttributesReq *req =
+ (xGLXChangeDrawableAttributesReq *) req;
+
+ return BadRequest;
+}
+
+int __glXSwapCreateWindow(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
+
+ (void) req;
+
+ return BadRequest;
+}
+
+int __glXSwapDestroyWindow(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
+
+ (void) req;
+
+ return BadRequest;
+}
+
int __glXSwapSwapBuffers(__GLXclientState *cl, GLbyte *pc)
{
xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
@@ -444,7 +506,19 @@ int __glXSwapGetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(data);
- return __glXGetDrawableAttributesSGIX(cl, (GLbyte *)pc);
+ return __glXGetDrawableAttributesSGIX(cl, pc);
+}
+
+int __glXSwapGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->drawable);
+
+ return __glXGetDrawableAttributes(cl, pc);
}
diff --git a/GL/glx/glxext.h b/GL/glx/glxext.h
index 5d569899f..34d361217 100644
--- a/GL/glx/glxext.h
+++ b/GL/glx/glxext.h
@@ -87,6 +87,9 @@ extern int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
GLXContextID shareList, VisualID visual, GLuint screen, GLboolean isDirect);
extern int DoCreateGLXPixmap(__GLXclientState *cl, VisualID visual,
GLuint screenNum, XID pixmapId, XID glxpixmapId);
+extern int DoDestroyPixmap(__GLXclientState *cl, XID glxpixmapId);
+
+extern int DoQueryContext(__GLXclientState *cl, GLXContextID gcId);
extern void GlxExtensionInit(void);