Fix build with GCC 2.95.
[mesa.git] / src / glx / x11 / dri_glx.c
index 82653f1625b82cb51aa7b9b34ce8dbcd71821b5e..44724d2c7d0ffce3ed21a356afca549eb4c3cc36 100644 (file)
@@ -37,7 +37,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <X11/Xlib.h>
 #include <X11/extensions/Xfixes.h>
 #include <X11/extensions/Xdamage.h>
-#include "glheader.h"
 #include "glxclient.h"
 #include "glcontextmodes.h"
 #include "xf86dri.h"
@@ -445,6 +444,7 @@ static void driDestroyContext(__GLXDRIcontext *context,
     (*psc->core->destroyContext)(pcp->driContext);
 
     XF86DRIDestroyContext(psc->dpy, psc->scr, pcp->hwContextID);
+    Xfree(pcp);
 }
 
 static Bool driBindContext(__GLXDRIcontext *context,
@@ -569,6 +569,18 @@ static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc,
     return pdraw;
 }
 
+static void driSwapBuffers(__GLXDRIdrawable *pdraw)
+{
+   (*pdraw->psc->core->swapBuffers)(pdraw->driDrawable);
+}
+
+static void driCopySubBuffer(__GLXDRIdrawable *pdraw,
+                            int x, int y, int width, int height)
+{
+    (*pdraw->psc->driCopySubBuffer->copySubBuffer)(pdraw->driDrawable,
+                                                  x, y, width, height);
+}
+
 static void driDestroyScreen(__GLXscreenConfigs *psc)
 {
     /* Free the direct rendering per screen data */
@@ -636,10 +648,13 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen,
     }
 
     driBindExtensions(psc, 0);
+    if (psc->driCopySubBuffer)
+       psp->copySubBuffer = driCopySubBuffer;
 
     psp->destroyScreen = driDestroyScreen;
     psp->createContext = driCreateContext;
     psp->createDrawable = driCreateDrawable;
+    psp->swapBuffers = driSwapBuffers;
 
     return psp;
 }