Merge commit 'origin/gallium-0.1' into gallium-0.2
[mesa.git] / src / mesa / drivers / x11 / glxapi.c
index 7945f1c5b0651020efabf9c18860401a84c71ec2..c2ccce6f520801c7f47e33c7d916a03830543e5b 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5
+ * Version:  7.1
  * 
- * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -34,8 +34,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include "glheader.h"
-#include "glapi.h"
+#include "main/glheader.h"
+#include "glapi/glapi.h"
 #include "glxapi.h"
 
 
@@ -141,7 +141,7 @@ static void
 SetCurrentContext(GLXContext c)
 {
 #if defined(GLX_USE_TLS)
-   CurrentContext = context;
+   CurrentContext = c;
 #elif defined(THREADS)
    _glthread_SetTSD(&ContextTSD, c);
 #else
@@ -241,7 +241,7 @@ glXGetCurrentContext(void)
 #if defined(GLX_USE_TLS)
    return CurrentContext;
 #elif defined(THREADS)
-   return _glthread_GetTSD(&ContextTSD);
+   return (GLXContext) _glthread_GetTSD(&ContextTSD);
 #else
    return CurrentContext;
 #endif
@@ -1104,6 +1104,27 @@ glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer)
 }
 
 
+/*** GLX_EXT_texture_from_pixmap */
+
+void
+glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer,
+                   const int *attrib_list)
+{
+   struct _glxapi_table *t;
+   GET_DISPATCH(dpy, t);
+   if (t)
+      t->BindTexImageEXT(dpy, drawable, buffer, attrib_list);
+}
+
+void
+glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer)
+{
+   struct _glxapi_table *t;
+   GET_DISPATCH(dpy, t);
+   if (t)
+      t->ReleaseTexImageEXT(dpy, drawable, buffer);
+}
+
 
 /**********************************************************************/
 /* GLX API management functions                                       */
@@ -1147,6 +1168,9 @@ _glxapi_get_extensions(void)
 #endif
 #ifdef GLX_SGIX_pbuffer
       "GLX_SGIX_pbuffer",
+#endif
+#ifdef GLX_EXT_texture_from_pixmap
+      "GLX_EXT_texture_from_pixmap",
 #endif
       NULL
    };
@@ -1333,6 +1357,10 @@ static struct name_address_pair GLX_functions[] = {
    { "glXFreeMemoryMESA", (__GLXextFuncPtr) glXFreeMemoryMESA },
    { "glXGetMemoryOffsetMESA", (__GLXextFuncPtr) glXGetMemoryOffsetMESA },
 
+   /*** GLX_EXT_texture_from_pixmap ***/
+   { "glXBindTexImageEXT", (__GLXextFuncPtr) glXBindTexImageEXT },
+   { "glXReleaseTexImageEXT", (__GLXextFuncPtr) glXReleaseTexImageEXT },
+
    { NULL, NULL }   /* end of list */
 };