summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/Makefile.X113
-rw-r--r--src/mesa/main/api_arrayelt.c54
-rw-r--r--src/mesa/main/api_loopback.c60
3 files changed, 64 insertions, 53 deletions
diff --git a/src/mesa/main/Makefile.X11 b/src/mesa/main/Makefile.X11
index 76bf931f11e..24a14536871 100644
--- a/src/mesa/main/Makefile.X11
+++ b/src/mesa/main/Makefile.X11
@@ -1,4 +1,4 @@
-# $Id: Makefile.X11,v 1.61 2001/12/14 16:35:55 kschultz Exp $
+# $Id: Makefile.X11,v 1.62 2001/12/20 15:30:45 keithw Exp $
# Mesa 3-D graphics library
# Version: 4.1
@@ -25,6 +25,7 @@ CORE_SOURCES = \
vpparse.c \
vpstate.c \
api_arrayelt.c \
+ api_compat.c \
api_loopback.c \
api_noop.c \
api_validate.c \
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index 288735d3b0e..fc2f714bd65 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -1,4 +1,4 @@
-/* $Id: api_arrayelt.c,v 1.3 2001/06/01 22:22:10 keithw Exp $ */
+/* $Id: api_arrayelt.c,v 1.4 2001/12/20 15:30:45 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,9 +24,14 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/* Author:
+ * Keith Whitwell <[email protected]>
+ */
+
#include "glheader.h"
#include "api_arrayelt.h"
#include "context.h"
+#include "glapi.h"
#include "mem.h"
#include "macros.h"
#include "mtypes.h"
@@ -164,35 +169,38 @@ static void (*normalfuncs[8])( const void * ) = {
(void (*)( const void * ))glNormal3dv,
};
-static void (*fogcoordfuncs[8])( const void * ) = {
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- (void (*)( const void * ))glFogCoordfvEXT,
- (void (*)( const void * ))glFogCoorddvEXT,
-};
-
-static void (*secondarycolorfuncs[8])( const void * ) = {
- (void (*)( const void * ))glSecondaryColor3bvEXT,
- (void (*)( const void * ))glSecondaryColor3ubvEXT,
- (void (*)( const void * ))glSecondaryColor3svEXT,
- (void (*)( const void * ))glSecondaryColor3usvEXT,
- (void (*)( const void * ))glSecondaryColor3ivEXT,
- (void (*)( const void * ))glSecondaryColor3uivEXT,
- (void (*)( const void * ))glSecondaryColor3fvEXT,
- (void (*)( const void * ))glSecondaryColor3dvEXT,
-};
-
+static void (*fogcoordfuncs[8])( const void * );
+static void (*secondarycolorfuncs[8])( const void * );
GLboolean _ae_create_context( GLcontext *ctx )
{
+ static int firsttime = 1;
+
ctx->aelt_context = MALLOC( sizeof(AEcontext) );
if (!ctx->aelt_context)
return GL_FALSE;
+
+ if (firsttime)
+ {
+ firsttime = 0;
+
+ /* Don't really want to use api_compat.h for this, but the
+ * rational for using _glaph_get_proc_address is the same.
+ */
+ fogcoordfuncs[0] = _glapi_get_proc_address("glSecondaryColor3bvEXT");
+ fogcoordfuncs[1] = _glapi_get_proc_address("glSecondaryColor3ubvEXT");
+ fogcoordfuncs[2] = _glapi_get_proc_address("glSecondaryColor3svEXT");
+ fogcoordfuncs[3] = _glapi_get_proc_address("glSecondaryColor3usvEXT");
+ fogcoordfuncs[4] = _glapi_get_proc_address("glSecondaryColor3ivEXT");
+ fogcoordfuncs[5] = _glapi_get_proc_address("glSecondaryColor3uivEXT");
+ fogcoordfuncs[6] = _glapi_get_proc_address("glSecondaryColor3fvEXT");
+ fogcoordfuncs[7] = _glapi_get_proc_address("glSecondaryColor3dvEXT");
+
+ secondarycolorfuncs[6] = _glapi_get_proc_address("glFogCoordfvEXT");
+ secondarycolorfuncs[7] = _glapi_get_proc_address("glFogCoorddvEXT");
+ }
+
AE_CONTEXT(ctx)->NewState = ~0;
return GL_TRUE;
}
diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c
index cf38a549013..7795935c0b5 100644
--- a/src/mesa/main/api_loopback.c
+++ b/src/mesa/main/api_loopback.c
@@ -1,4 +1,4 @@
-/* $Id: api_loopback.c,v 1.12 2001/12/14 02:50:01 brianp Exp $ */
+/* $Id: api_loopback.c,v 1.13 2001/12/20 15:30:45 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -32,6 +32,7 @@
#include "glapitable.h"
#include "macros.h"
#include "colormac.h"
+#include "api_compat.h"
#include "api_loopback.h"
/* KW: A set of functions to convert unusual Color/Normal/Vertex/etc
@@ -43,30 +44,31 @@
* listed in dd.h. The easiest way for a driver to do this is to
* install the supplied software t&l module.
*/
-#define DRIVER(x) gl##x
-#define COLORUBV(v) DRIVER(Color4ubv)(v)
-#define COLORF(r,g,b,a) DRIVER(Color4f)(r,g,b,a)
-#define FOGCOORDF(x) DRIVER(FogCoordfEXT)(x)
-#define VERTEX2(x,y) DRIVER(Vertex2f)(x,y)
-#define VERTEX3(x,y,z) DRIVER(Vertex3f)(x,y,z)
-#define VERTEX4(x,y,z,w) DRIVER(Vertex4f)(x,y,z,w)
-#define NORMAL(x,y,z) DRIVER(Normal3f)(x,y,z)
-#define TEXCOORD1(s) DRIVER(TexCoord1f)(s)
-#define TEXCOORD2(s,t) DRIVER(TexCoord2f)(s,t)
-#define TEXCOORD3(s,t,u) DRIVER(TexCoord3f)(s,t,u)
-#define TEXCOORD4(s,t,u,v) DRIVER(TexCoord4f)(s,t,u,v)
-#define INDEX(c) DRIVER(Indexi)(c)
-#define MULTI_TEXCOORD1(z,s) DRIVER(MultiTexCoord1fARB)(z,s)
-#define MULTI_TEXCOORD2(z,s,t) DRIVER(MultiTexCoord2fARB)(z,s,t)
-#define MULTI_TEXCOORD3(z,s,t,u) DRIVER(MultiTexCoord3fARB)(z,s,t,u)
-#define MULTI_TEXCOORD4(z,s,t,u,v) DRIVER(MultiTexCoord4fARB)(z,s,t,u,v)
-#define EVALCOORD1(x) DRIVER(EvalCoord1f)(x)
-#define EVALCOORD2(x,y) DRIVER(EvalCoord2f)(x,y)
-#define MATERIALFV(a,b,c) DRIVER(Materialfv)(a,b,c)
-#define RECTF(a,b,c,d) DRIVER(Rectf)(a,b,c,d)
-#define SECONDARYCOLORUB(a,b,c) DRIVER(SecondaryColor3ubEXT)(a,b,c)
-#define SECONDARYCOLORF(a,b,c) DRIVER(SecondaryColor3fEXT)(a,b,c)
-#define ATTRIB(index, x, y, z, w) DRIVER(VertexAttrib4fNV)(index, x, y, z, w)
+#define COLORUBV(v) glColor4ubv(v)
+#define COLORF(r,g,b,a) glColor4f(r,g,b,a)
+#define VERTEX2(x,y) glVertex2f(x,y)
+#define VERTEX3(x,y,z) glVertex3f(x,y,z)
+#define VERTEX4(x,y,z,w) glVertex4f(x,y,z,w)
+#define NORMAL(x,y,z) glNormal3f(x,y,z)
+#define TEXCOORD1(s) glTexCoord1f(s)
+#define TEXCOORD2(s,t) glTexCoord2f(s,t)
+#define TEXCOORD3(s,t,u) glTexCoord3f(s,t,u)
+#define TEXCOORD4(s,t,u,v) glTexCoord4f(s,t,u,v)
+#define INDEX(c) glIndexi(c)
+#define MULTI_TEXCOORD1(z,s) glMultiTexCoord1fARB(z,s)
+#define MULTI_TEXCOORD2(z,s,t) glMultiTexCoord2fARB(z,s,t)
+#define MULTI_TEXCOORD3(z,s,t,u) glMultiTexCoord3fARB(z,s,t,u)
+#define MULTI_TEXCOORD4(z,s,t,u,v) glMultiTexCoord4fARB(z,s,t,u,v)
+#define EVALCOORD1(x) glEvalCoord1f(x)
+#define EVALCOORD2(x,y) glEvalCoord2f(x,y)
+#define MATERIALFV(a,b,c) glMaterialfv(a,b,c)
+#define RECTF(a,b,c,d) glRectf(a,b,c,d)
+
+
+
+#define FOGCOORDF(x) _compat_FogCoordfEXT(x)
+#define SECONDARYCOLORUB(a,b,c) _compat_SecondaryColor3ubEXT(a,b,c)
+#define SECONDARYCOLORF(a,b,c) _compat_SecondaryColor3fEXT(a,b,c)
static void
@@ -1224,10 +1226,10 @@ loopback_SecondaryColor3usEXT( GLushort red, GLushort green, GLushort blue )
static void
loopback_SecondaryColor3bvEXT( const GLbyte *v )
{
- const GLfloat r = BYTE_TO_FLOAT(v[0]);
- const GLfloat g = BYTE_TO_FLOAT(v[1]);
- const GLfloat b = BYTE_TO_FLOAT(v[2]);
- SECONDARYCOLORF(r, g, b);
+ const GLfloat a = BYTE_TO_FLOAT(v[0]);
+ const GLfloat b = BYTE_TO_FLOAT(v[1]);
+ const GLfloat c = BYTE_TO_FLOAT(v[2]);
+ SECONDARYCOLORF(a,b,c);
}
static void