summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_arrayelt.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-01-14 16:06:35 +0000
committerBrian Paul <[email protected]>2002-01-14 16:06:35 +0000
commit03c0c2e8aa5e5f1b430c4b3faa1f9ad92b1b71eb (patch)
tree55bf8e203cfed465a739519a9a22a4e3dc70e65b /src/mesa/main/api_arrayelt.c
parentfe9f62ff18a093bf3ecff6edea509cb72c9d14a6 (diff)
Removed api_compat stuff, there's a better way.
Fixed FogCoord / SecondaryColor mix-ups in api_arrayelt.c
Diffstat (limited to 'src/mesa/main/api_arrayelt.c')
-rw-r--r--src/mesa/main/api_arrayelt.c108
1 files changed, 80 insertions, 28 deletions
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index f5b3695bfd9..98be1699eaf 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -1,10 +1,10 @@
-/* $Id: api_arrayelt.c,v 1.5 2001/12/28 06:28:10 gareth Exp $ */
+/* $Id: api_arrayelt.c,v 1.6 2002/01/14 16:06:35 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
@@ -172,38 +172,90 @@ static void (*normalfuncs[8])( const void * ) = {
(array_func)glNormal3dv,
};
-static void (*fogcoordfuncs[8])( const void * );
-static void (*secondarycolorfuncs[8])( const void * );
-GLboolean _ae_create_context( GLcontext *ctx )
+/* Wrapper functions in case glSecondaryColor*EXT doesn't exist */
+static void SecondaryColor3bvEXT(const GLbyte *c)
+{
+ _glapi_Dispatch->SecondaryColor3bvEXT(c);
+}
+
+static void SecondaryColor3ubvEXT(const GLubyte *c)
+{
+ _glapi_Dispatch->SecondaryColor3ubvEXT(c);
+}
+
+static void SecondaryColor3svEXT(const GLshort *c)
+{
+ _glapi_Dispatch->SecondaryColor3svEXT(c);
+}
+
+static void SecondaryColor3usvEXT(const GLushort *c)
+{
+ _glapi_Dispatch->SecondaryColor3usvEXT(c);
+}
+
+static void SecondaryColor3ivEXT(const GLint *c)
+{
+ _glapi_Dispatch->SecondaryColor3ivEXT(c);
+}
+
+static void SecondaryColor3uivEXT(const GLuint *c)
+{
+ _glapi_Dispatch->SecondaryColor3uivEXT(c);
+}
+
+static void SecondaryColor3fvEXT(const GLfloat *c)
+{
+ _glapi_Dispatch->SecondaryColor3fvEXT(c);
+}
+
+static void SecondaryColor3dvEXT(const GLdouble *c)
{
- static int firsttime = 1;
+ _glapi_Dispatch->SecondaryColor3dvEXT(c);
+}
+static void (*secondarycolorfuncs[8])( const void * ) = {
+ (array_func) SecondaryColor3bvEXT,
+ (array_func) SecondaryColor3ubvEXT,
+ (array_func) SecondaryColor3svEXT,
+ (array_func) SecondaryColor3usvEXT,
+ (array_func) SecondaryColor3ivEXT,
+ (array_func) SecondaryColor3uivEXT,
+ (array_func) SecondaryColor3fvEXT,
+ (array_func) SecondaryColor3dvEXT,
+};
+
+
+/* Again, wrapper functions in case glSecondaryColor*EXT doesn't exist */
+static void FogCoordfvEXT(const GLfloat *f)
+{
+ _glapi_Dispatch->FogCoordfvEXT(f);
+}
+
+static void FogCoorddvEXT(const GLdouble *f)
+{
+ _glapi_Dispatch->FogCoorddvEXT(f);
+}
+
+static void (*fogcoordfuncs[8])( const void * ) = {
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ (array_func) FogCoordfvEXT,
+ (array_func) FogCoorddvEXT
+};
+
+
+
+GLboolean _ae_create_context( GLcontext *ctx )
+{
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 _glapi_get_proc_address is the same.
- */
- fogcoordfuncs[0] = (array_func) _glapi_get_proc_address("glSecondaryColor3bvEXT");
- fogcoordfuncs[1] = (array_func) _glapi_get_proc_address("glSecondaryColor3ubvEXT");
- fogcoordfuncs[2] = (array_func) _glapi_get_proc_address("glSecondaryColor3svEXT");
- fogcoordfuncs[3] = (array_func) _glapi_get_proc_address("glSecondaryColor3usvEXT");
- fogcoordfuncs[4] = (array_func) _glapi_get_proc_address("glSecondaryColor3ivEXT");
- fogcoordfuncs[5] = (array_func) _glapi_get_proc_address("glSecondaryColor3uivEXT");
- fogcoordfuncs[6] = (array_func) _glapi_get_proc_address("glSecondaryColor3fvEXT");
- fogcoordfuncs[7] = (array_func) _glapi_get_proc_address("glSecondaryColor3dvEXT");
-
- secondarycolorfuncs[6] = (array_func) _glapi_get_proc_address("glFogCoordfvEXT");
- secondarycolorfuncs[7] = (array_func) _glapi_get_proc_address("glFogCoorddvEXT");
- }
-
AE_CONTEXT(ctx)->NewState = ~0;
return GL_TRUE;
}