Merge branch 'mesa_7_6_branch'
[mesa.git] / src / mesa / drivers / dri / s3v / s3v_xmesa.c
index 533424cdeab26f57f82c657bcac3e9fdc0c08a3f..85f148176965912d87993bfed1b45a5d249bf3fd 100644 (file)
@@ -4,21 +4,22 @@
 
 #include "s3v_context.h"
 #include "s3v_vb.h"
-#include "context.h"
-#include "matrix.h"
 #include "s3v_dri.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
+#include "main/context.h"
+#include "main/matrix.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/viewport.h"
 
 #include "swrast/swrast.h"
 #include "swrast_setup/swrast_setup.h"
 #include "tnl/tnl.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
 
 /* #define DEBUG(str) printf str */
 
-static GLboolean 
-s3vInitDriver(__DRIscreenPrivate *sPriv)
+static const __DRIconfig **
+s3vInitScreen(__DRIscreen *sPriv)
 {
     sPriv->private = (void *) s3vCreateScreen( sPriv );
 
@@ -27,7 +28,7 @@ s3vInitDriver(__DRIscreenPrivate *sPriv)
        return GL_FALSE;
     }
 
-    return GL_TRUE;
+   return NULL;
 }
 
 static void 
@@ -38,7 +39,7 @@ s3vDestroyContext(__DRIcontextPrivate *driContextPriv)
     if (vmesa) {
       _swsetup_DestroyContext( vmesa->glCtx );
       _tnl_DestroyContext( vmesa->glCtx );
-      _ac_DestroyContext( vmesa->glCtx );
+      _vbo_DestroyContext( vmesa->glCtx );
       _swrast_DestroyContext( vmesa->glCtx );
 
       s3vFreeVB( vmesa->glCtx );
@@ -131,7 +132,7 @@ s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv,
 static void
 s3vDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
 {
-   _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
+   _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
 }
 
 static void
@@ -327,34 +328,14 @@ s3vUnbindContext( __DRIcontextPrivate *driContextPriv )
    return GL_TRUE;
 }
 
-
-static struct __DriverAPIRec s3vAPI = {
-   s3vInitDriver,
-   s3vDestroyScreen,
-   s3vCreateContext,
-   s3vDestroyContext,
-   s3vCreateBuffer,
-   s3vDestroyBuffer,
-   s3vSwapBuffers,
-   s3vMakeCurrent,
-   s3vUnbindContext,
+const struct __DriverAPIRec driDriverAPI = {
+   .InitScreen    = s3vInitScreen,
+   .DestroyScreen  = s3vDestroyScreen,
+   .CreateContext  = s3vCreateContext,
+   .DestroyContext = s3vDestroyContext,
+   .CreateBuffer   = s3vCreateBuffer,
+   .DestroyBuffer  = s3vDestroyBuffer,
+   .SwapBuffers           = s3vSwapBuffers,
+   .MakeCurrent           = s3vMakeCurrent,
+   .UnbindContext  = s3vUnbindContext,
 };
-
-
-#if 0
-/*
- * This is the bootstrap function for the driver.
- * The __driCreateScreen name is the symbol that libGL.so fetches.
- * Return:  pointer to a __DRIscreenPrivate.
- */
-void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
-                        int numConfigs, __GLXvisualConfig *config)
-{
-   __DRIscreenPrivate *psp=NULL;
-
-   DEBUG(("__driCreateScreen: psp = %p\n", psp));
-   psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &s3vAPI);
-   DEBUG(("__driCreateScreen: psp = %p\n", psp));
-   return (void *) psp;
-}
-#endif