Remove leftover __DRI{screen,drawable,context}Private references
[mesa.git] / src / mesa / drivers / dri / mach64 / mach64_context.c
index ad661e198cda9264687102b74c7cf8ba5293bcee..3b4ef7ffd82a9dc3b2c44f83932652cd3985e226 100644 (file)
@@ -1,4 +1,4 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
+/* -*- mode: c; c-basic-offset: 3 -*- */
 /*
  * Copyright 2000 Gareth Hughes
  * All Rights Reserved.
  *     Jos�Fonseca <j_r_fonseca@yahoo.co.uk>
  */
 
-#include "glheader.h"
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/simple_list.h"
+#include "main/imports.h"
+#include "main/matrix.h"
+#include "main/extensions.h"
 
 #include "swrast/swrast.h"
 #include "swrast_setup/swrast_setup.h"
 #include "utils.h"
 #include "vblank.h"
 
-#define need_GL_ARB_multisample
-#define need_GL_ARB_vertex_buffer_object
-#include "extension_helper.h"
-
 #ifndef MACH64_DEBUG
 int MACH64_DEBUG = (0);
 #endif
@@ -80,11 +76,9 @@ static const struct dri_debug_control debug_control[] =
     { NULL,    0 }
 };
 
-const struct dri_extension card_extensions[] =
+static const struct dri_extension card_extensions[] =
 {
-    { "GL_ARB_multisample",                GL_ARB_multisample_functions },
     { "GL_ARB_multitexture",               NULL },
-    { "GL_ARB_vertex_buffer_object",       GL_ARB_vertex_buffer_object_functions },
     { "GL_EXT_texture_edge_clamp",         NULL },
     { "GL_MESA_ycbcr_texture",             NULL },
     { "GL_SGIS_generate_mipmap",           NULL },
@@ -95,11 +89,11 @@ const struct dri_extension card_extensions[] =
 /* Create the device specific context.
   */
 GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
-                              __DRIcontextPrivate *driContextPriv,
+                              __DRIcontext *driContextPriv,
                                void *sharedContextPrivate )
 {
    GLcontext *ctx, *shareCtx;
-   __DRIscreenPrivate *driScreen = driContextPriv->driScreenPriv;
+   __DRIscreen *driScreen = driContextPriv->driScreenPriv;
    struct dd_function_table functions;
    mach64ContextPtr mmesa;
    mach64ScreenPtr mach64Screen;
@@ -196,6 +190,7 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
    ctx->Const.MaxTextureUnits = 2;
    ctx->Const.MaxTextureImageUnits = 2;
    ctx->Const.MaxTextureCoordUnits = 2;
+   ctx->Const.MaxDrawBuffers = 1;
 
    heap = mach64Screen->IsPCI ? MACH64_CARD_HEAP : MACH64_AGP_HEAP;
 
@@ -253,9 +248,6 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
 
    mmesa->do_irqs = (mmesa->mach64Screen->irq && !getenv("MACH64_NO_IRQS"));
 
-   mmesa->vblank_flags = (mmesa->do_irqs)
-      ? driGetDefaultVBlankFlags(&mmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
-
    driContextPriv->driverPrivate = (void *)mmesa;
 
    if (driQueryOptionb(&mmesa->optionCache, "no_rast")) {
@@ -268,7 +260,7 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
 
 /* Destroy the device specific context.
  */
-void mach64DestroyContext( __DRIcontextPrivate *driContextPriv  )
+void mach64DestroyContext( __DRIcontext *driContextPriv  )
 {
    mach64ContextPtr mmesa = (mach64ContextPtr) driContextPriv->driverPrivate;
 
@@ -315,9 +307,9 @@ void mach64DestroyContext( __DRIcontextPrivate *driContextPriv  )
  * buffer `b'.
  */
 GLboolean
-mach64MakeCurrent( __DRIcontextPrivate *driContextPriv,
-                 __DRIdrawablePrivate *driDrawPriv,
-                 __DRIdrawablePrivate *driReadPriv )
+mach64MakeCurrent( __DRIcontext *driContextPriv,
+                 __DRIdrawable *driDrawPriv,
+                 __DRIdrawable *driReadPriv )
 {
    if ( driContextPriv ) {
       GET_CURRENT_CONTEXT(ctx);
@@ -330,10 +322,15 @@ mach64MakeCurrent( __DRIcontextPrivate *driContextPriv,
       }
 
       
-      driDrawableInitVBlank( driDrawPriv, newMach64Ctx->vblank_flags,
-                            &newMach64Ctx->vbl_seq );
-
       if ( newMach64Ctx->driDrawable != driDrawPriv ) {
+        if (driDrawPriv->swap_interval == (unsigned)-1) {
+           driDrawPriv->vblFlags = (newMach64Ctx->do_irqs)
+              ? driGetDefaultVBlankFlags(&newMach64Ctx->optionCache)
+              : VBLANK_FLAG_NO_IRQ;
+
+           driDrawableInitVBlank( driDrawPriv );
+        }
+
         newMach64Ctx->driDrawable = driDrawPriv;
         mach64CalcViewport( newMach64Ctx->glCtx );
       }
@@ -355,7 +352,7 @@ mach64MakeCurrent( __DRIcontextPrivate *driContextPriv,
 /* Force the context `c' to be unbound from its buffer.
  */
 GLboolean
-mach64UnbindContext( __DRIcontextPrivate *driContextPriv )
+mach64UnbindContext( __DRIcontext *driContextPriv )
 {
    return GL_TRUE;
 }