remove stray 'foo' line
[mesa.git] / src / glx / x11 / glxcmds.c
index fbb6e7b36810f84a491c7764d250ec7fda1db9b7..d23a53071048a38a14167b74ba435cf3f1384dd7 100644 (file)
 
 #include <inttypes.h>
 #include "glxclient.h"
-#include <extutil.h>
-#include <Xext.h>
+#include <X11/extensions/extutil.h>
+#include <X11/extensions/Xext.h>
 #include <assert.h>
 #include <string.h>
 #include "glapi.h"
 #ifdef GLX_DIRECT_RENDERING
 #include "indirect_init.h"
-#include "xf86vmode.h"
+#include <X11/extensions/xf86vmode.h>
 #include "xf86dri.h"
 #endif
 #include "glxextensions.h"
@@ -1269,7 +1269,7 @@ PUBLIC const char *glXQueryExtensionsString( Display *dpy, int screen )
 
        __glXCalculateUsableExtensions(psc,
 #ifdef GLX_DIRECT_RENDERING
-                                      (priv->driDisplay.private != NULL),
+                                      (psc->driScreen.private != NULL),
 #else
                                       GL_FALSE,
 #endif
@@ -2589,7 +2589,87 @@ PUBLIC Bool glXSet3DfxModeMESA( int mode )
 }
 /*@}*/
 
+PUBLIC Bool glXBindTexImageEXT(Display *dpy,
+                              GLXDrawable drawable,
+                              int buffer)
+{
+    xGLXVendorPrivateReq *req;
+    GLXContext gc = __glXGetCurrentContext();
+    CARD32 *drawable_ptr;
+    INT32 *buffer_ptr;
+    CARD8 opcode;
 
+    if (gc == NULL)
+       return False;
+
+#ifdef GLX_DIRECT_RENDERING
+    if (gc->isDirect)
+       return False;
+#endif
+
+    opcode = __glXSetupForCommand(dpy);
+    if (!opcode)
+       return False;
+
+    LockDisplay(dpy);
+    GetReqExtra(GLXVendorPrivate, sizeof(CARD32)+sizeof(INT32),req);
+    req->reqType = opcode;
+    req->glxCode = X_GLXVendorPrivate;
+    req->vendorCode = X_GLXvop_BindTexImageEXT;
+    req->contextTag = gc->currentContextTag;
+
+    drawable_ptr = (CARD32 *) (req + 1);
+    buffer_ptr = (INT32 *) (drawable_ptr + 1);
+
+    *drawable_ptr = drawable;
+    *buffer_ptr = buffer;
+
+    UnlockDisplay(dpy);
+    SyncHandle();
+
+    return True;
+}
+
+PUBLIC Bool glXReleaseTexImageEXT(Display *dpy,
+                                 GLXDrawable drawable,
+                                 int buffer)
+{
+    xGLXVendorPrivateReq *req;
+    GLXContext gc = __glXGetCurrentContext();
+    CARD32 *drawable_ptr;
+    INT32 *buffer_ptr;
+    CARD8 opcode;
+
+    if (gc == NULL)
+       return False;
+
+#ifdef GLX_DIRECT_RENDERING
+    if (gc->isDirect)
+       return False;
+#endif
+
+    opcode = __glXSetupForCommand(dpy);
+    if (!opcode)
+       return False;
+
+    LockDisplay(dpy);
+    GetReqExtra(GLXVendorPrivate, sizeof(CARD32)+sizeof(INT32),req);
+    req->reqType = opcode;
+    req->glxCode = X_GLXVendorPrivate;
+    req->vendorCode = X_GLXvop_ReleaseTexImageEXT;
+    req->contextTag = gc->currentContextTag;
+
+    drawable_ptr = (CARD32 *) (req + 1);
+    buffer_ptr = (INT32 *) (drawable_ptr + 1);
+
+    *drawable_ptr = drawable;
+    *buffer_ptr = buffer;
+
+    UnlockDisplay(dpy);
+    SyncHandle();
+
+    return True;
+}
 
 /**
  * \c strdup is actually not a standard ANSI C or POSIX routine.
@@ -2771,6 +2851,10 @@ static const struct name_address_pair GLX_functions[] = {
    GLX_FUNCTION( glXGetMscRateOML ),
    GLX_FUNCTION( glXGetSyncValuesOML ),
 
+   /*** GLX_EXT_texture_from_pixmap ***/
+   GLX_FUNCTION( glXBindTexImageEXT ),
+   GLX_FUNCTION( glXReleaseTexImageEXT ),
+
 #ifdef GLX_DIRECT_RENDERING
    /*** DRI configuration ***/
    GLX_FUNCTION( glXGetScreenDriver ),