Use smooth shaded triangles always. Fix SoF bug.
[mesa.git] / src / mesa / drivers / x11 / glxapi.c
index f64bc20bdeffd56caf42fd5dfa6544749225280b..93e5808ddbcdaada34c7faa8c0d9b1065c8d633a 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: glxapi.c,v 1.8 1999/11/28 20:07:33 brianp Exp $ */
+/* $Id: glxapi.c,v 1.16 2000/04/10 21:13:19 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
  * Version:  3.3
  * 
- * Copyright (C) 1999  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2000  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,6 +34,7 @@
 
 #include <assert.h>
 #include <stdlib.h>
+#include "glapi.h"
 #include "glxapi.h"
 
 
@@ -168,7 +169,7 @@ XVisualInfo *glXChooseVisual(Display *dpy, int screen, int *list)
 }
 
 
-void glXCopyContext(Display *dpy, GLXContext src, GLXContext dst, GLuint mask)
+void glXCopyContext(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask)
 {
    struct _glxapi_table *t = get_dispatch(dpy);
    if (!t)
@@ -358,7 +359,7 @@ Display *glXGetCurrentDisplay(void)
 
 #ifdef _GLXAPI_VERSION_1_3
 
-GLXFBConfig glXChooseFBConfig(Display *dpy, int screen, const int *attribList, int *nitems)
+GLXFBConfig *glXChooseFBConfig(Display *dpy, int screen, const int *attribList, int *nitems)
 {
    struct _glxapi_table *t = get_dispatch(dpy);
    if (!t)
@@ -445,6 +446,14 @@ int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config, int attribute, int *v
 }
 
 
+GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements)
+{
+   struct _glxapi_table *t = get_dispatch(dpy);
+   if (!t)
+      return 0;
+   return (t->GetFBConfigs)(dpy, screen, nelements);
+}
+
 void glXGetSelectedEvent(Display *dpy, GLXDrawable drawable, unsigned long *mask)
 {
    struct _glxapi_table *t = get_dispatch(dpy);
@@ -720,6 +729,8 @@ static struct name_address_pair GLX_functions[] = {
    { "glXDestroyContext", (GLvoid *) glXDestroyContext },
    { "glXDestroyGLXPixmap", (GLvoid *) glXDestroyGLXPixmap },
    { "glXGetConfig", (GLvoid *) glXGetConfig },
+   { "glXGetCurrentContext", (GLvoid *) glXGetCurrentContext },
+   { "glXGetCurrentDrawable", (GLvoid *) glXGetCurrentDrawable },
    { "glXIsDirect", (GLvoid *) glXIsDirect },
    { "glXMakeCurrent", (GLvoid *) glXMakeCurrent },
    { "glXQueryExtension", (GLvoid *) glXQueryExtension },
@@ -736,7 +747,7 @@ static struct name_address_pair GLX_functions[] = {
 #endif
 
 #ifdef _GLXAPI_VERSION_1_2
-   /*{ "glXGetCurrentDisplay", (GLvoid *) glXGetCurrentDisplay },*/
+   { "glXGetCurrentDisplay", (GLvoid *) glXGetCurrentDisplay },
 #endif
 
 #ifdef _GLXAPI_VERSION_1_3
@@ -748,6 +759,7 @@ static struct name_address_pair GLX_functions[] = {
    { "glXDestroyPbuffer", (GLvoid *) glXDestroyPbuffer },
    { "glXDestroyPixmap", (GLvoid *) glXDestroyPixmap },
    { "glXDestroyWindow", (GLvoid *) glXDestroyWindow },
+   { "glXGetCurrentReadDrawable", (GLvoid *) glXGetCurrentReadDrawable },
    { "glXGetFBConfigAttrib", (GLvoid *) glXGetFBConfigAttrib },
    { "glXGetSelectedEvent", (GLvoid *) glXGetSelectedEvent },
    { "glXGetVisualFromFBConfig", (GLvoid *) glXGetVisualFromFBConfig },
@@ -778,6 +790,8 @@ static struct name_address_pair GLX_functions[] = {
    { "glXSet3DfxModeMESA", (GLvoid *) glXSet3DfxModeMESA },
 #endif
 
+   { "glXGetProcAddressARB", (GLvoid *) glXGetProcAddressARB },
+
    { NULL, NULL }   /* end of list */
 };
 
@@ -796,3 +810,23 @@ _glxapi_get_proc_address(const char *funcName)
    }
    return NULL;
 }
+
+
+
+/*
+ * This function does not get dispatched through the dispatch table
+ * since it's really a "meta" function.
+ */
+void (*glXGetProcAddressARB(const GLubyte *procName))()
+{
+   typedef void (*gl_function)();
+   gl_function f;
+
+   f = (gl_function) _glxapi_get_proc_address((const char *) procName);
+   if (f) {
+      return f;
+   }
+
+   f = (gl_function) _glapi_get_proc_address((const char *) procName);
+   return f;
+}