diff options
author | Brian Paul <[email protected]> | 2002-01-15 20:17:59 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-01-15 20:17:59 +0000 |
commit | b36acc0423982ada32691a5fca5d88385a23ca52 (patch) | |
tree | 236e0a4e49d58bca27e159d66b6c2beda4baeb9b /src/mesa | |
parent | 287d6127d2c9d96b5873411fea867c142f69874d (diff) |
removed API compat stuff
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/Makefile.X11 | 3 | ||||
-rw-r--r-- | src/mesa/main/Makefile.X11 | 3 | ||||
-rw-r--r-- | src/mesa/main/api_arrayelt.c | 228 | ||||
-rw-r--r-- | src/mesa/main/api_loopback.c | 14 | ||||
-rw-r--r-- | src/mesa/tnl/t_imm_dlist.c | 7 |
5 files changed, 153 insertions, 102 deletions
diff --git a/src/mesa/Makefile.X11 b/src/mesa/Makefile.X11 index c868049dcf6..789619aa121 100644 --- a/src/mesa/Makefile.X11 +++ b/src/mesa/Makefile.X11 @@ -1,4 +1,4 @@ -# $Id: Makefile.X11,v 1.58.2.3 2001/12/20 15:29:15 keithw Exp $ +# $Id: Makefile.X11,v 1.58.2.4 2002/01/15 20:17:59 brianp Exp $ # Mesa 3-D graphics library # Version: 4.0.1 @@ -26,7 +26,6 @@ CORE_SOURCES = \ swrast_setup/ss_vb.c \ api_arrayelt.c \ api_loopback.c \ - api_compat.c \ api_noop.c \ api_validate.c \ accum.c \ diff --git a/src/mesa/main/Makefile.X11 b/src/mesa/main/Makefile.X11 index c868049dcf6..789619aa121 100644 --- a/src/mesa/main/Makefile.X11 +++ b/src/mesa/main/Makefile.X11 @@ -1,4 +1,4 @@ -# $Id: Makefile.X11,v 1.58.2.3 2001/12/20 15:29:15 keithw Exp $ +# $Id: Makefile.X11,v 1.58.2.4 2002/01/15 20:17:59 brianp Exp $ # Mesa 3-D graphics library # Version: 4.0.1 @@ -26,7 +26,6 @@ CORE_SOURCES = \ swrast_setup/ss_vb.c \ api_arrayelt.c \ api_loopback.c \ - api_compat.c \ api_noop.c \ api_validate.c \ accum.c \ diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 2fa8ef2df95..6e836ebcfb4 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.3.2.1 2001/12/20 15:29:15 keithw Exp $ */ +/* $Id: api_arrayelt.c,v 1.3.2.2 2002/01/15 20:17:59 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.2 * - * 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"), @@ -37,16 +37,19 @@ #include "mtypes.h" +typedef void (*texarray_func)( GLenum, const void * ); + typedef struct { GLint unit; struct gl_client_array *array; - void (*func)( GLenum, const void * ); + texarray_func func; } AEtexarray; +typedef void (*array_func)( const void * ); typedef struct { struct gl_client_array *array; - void (*func)( const void * ); + array_func func; } AEarray; typedef struct { @@ -59,149 +62,200 @@ typedef struct { #define TYPE_IDX(t) ((t) & 0xf) static void (*colorfuncs[2][8])( const void * ) = { - { (void (*)( const void * ))glColor3bv, - (void (*)( const void * ))glColor3ub, - (void (*)( const void * ))glColor3sv, - (void (*)( const void * ))glColor3usv, - (void (*)( const void * ))glColor3iv, - (void (*)( const void * ))glColor3uiv, - (void (*)( const void * ))glColor3fv, - (void (*)( const void * ))glColor3dv }, - - { (void (*)( const void * ))glColor4bv, - (void (*)( const void * ))glColor4ub, - (void (*)( const void * ))glColor4sv, - (void (*)( const void * ))glColor4usv, - (void (*)( const void * ))glColor4iv, - (void (*)( const void * ))glColor4uiv, - (void (*)( const void * ))glColor4fv, - (void (*)( const void * ))glColor4dv } + { (array_func)glColor3bv, + (array_func)glColor3ub, + (array_func)glColor3sv, + (array_func)glColor3usv, + (array_func)glColor3iv, + (array_func)glColor3uiv, + (array_func)glColor3fv, + (array_func)glColor3dv }, + + { (array_func)glColor4bv, + (array_func)glColor4ub, + (array_func)glColor4sv, + (array_func)glColor4usv, + (array_func)glColor4iv, + (array_func)glColor4uiv, + (array_func)glColor4fv, + (array_func)glColor4dv } }; static void (*vertexfuncs[3][8])( const void * ) = { { 0, 0, - (void (*)( const void * ))glVertex2sv, + (array_func)glVertex2sv, 0, - (void (*)( const void * ))glVertex2iv, + (array_func)glVertex2iv, 0, - (void (*)( const void * ))glVertex2fv, - (void (*)( const void * ))glVertex2dv }, + (array_func)glVertex2fv, + (array_func)glVertex2dv }, { 0, 0, - (void (*)( const void * ))glVertex3sv, + (array_func)glVertex3sv, 0, - (void (*)( const void * ))glVertex3iv, + (array_func)glVertex3iv, 0, - (void (*)( const void * ))glVertex3fv, - (void (*)( const void * ))glVertex3dv }, + (array_func)glVertex3fv, + (array_func)glVertex3dv }, { 0, 0, - (void (*)( const void * ))glVertex4sv, + (array_func)glVertex4sv, 0, - (void (*)( const void * ))glVertex4iv, + (array_func)glVertex4iv, 0, - (void (*)( const void * ))glVertex4fv, - (void (*)( const void * ))glVertex4dv } + (array_func)glVertex4fv, + (array_func)glVertex4dv } }; static void (*multitexfuncs[4][8])( GLenum, const void * ) = { { 0, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord1svARB, + (texarray_func)glMultiTexCoord1svARB, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord1ivARB, + (texarray_func)glMultiTexCoord1ivARB, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord1fvARB, - (void (*)( GLenum, const void * ))glMultiTexCoord1dvARB }, + (texarray_func)glMultiTexCoord1fvARB, + (texarray_func)glMultiTexCoord1dvARB }, { 0, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord2svARB, + (texarray_func)glMultiTexCoord2svARB, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord2ivARB, + (texarray_func)glMultiTexCoord2ivARB, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord2fvARB, - (void (*)( GLenum, const void * ))glMultiTexCoord2dvARB }, + (texarray_func)glMultiTexCoord2fvARB, + (texarray_func)glMultiTexCoord2dvARB }, { 0, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord3svARB, + (texarray_func)glMultiTexCoord3svARB, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord3ivARB, + (texarray_func)glMultiTexCoord3ivARB, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord3fvARB, - (void (*)( GLenum, const void * ))glMultiTexCoord3dvARB }, + (texarray_func)glMultiTexCoord3fvARB, + (texarray_func)glMultiTexCoord3dvARB }, { 0, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord4svARB, + (texarray_func)glMultiTexCoord4svARB, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord4ivARB, + (texarray_func)glMultiTexCoord4ivARB, 0, - (void (*)( GLenum, const void * ))glMultiTexCoord4fvARB, - (void (*)( GLenum, const void * ))glMultiTexCoord4dvARB } + (texarray_func)glMultiTexCoord4fvARB, + (texarray_func)glMultiTexCoord4dvARB } }; static void (*indexfuncs[8])( const void * ) = { 0, - (void (*)( const void * ))glIndexubv, - (void (*)( const void * ))glIndexsv, + (array_func)glIndexubv, + (array_func)glIndexsv, 0, - (void (*)( const void * ))glIndexiv, + (array_func)glIndexiv, 0, - (void (*)( const void * ))glIndexfv, - (void (*)( const void * ))glIndexdv + (array_func)glIndexfv, + (array_func)glIndexdv }; static void (*normalfuncs[8])( const void * ) = { - (void (*)( const void * ))glNormal3bv, + (array_func)glNormal3bv, 0, - (void (*)( const void * ))glNormal3sv, + (array_func)glNormal3sv, 0, - (void (*)( const void * ))glNormal3iv, + (array_func)glNormal3iv, 0, - (void (*)( const void * ))glNormal3fv, - (void (*)( const void * ))glNormal3dv, + (array_func)glNormal3fv, + (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) +{ + _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) { - static int firsttime = 1; + _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 - * rationale for using _glaph_get_proc_address is the same. No - * benefit to shortcircuiting this in the non-dri case, either. - */ - 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; } @@ -253,7 +307,7 @@ static void _ae_update_state( GLcontext *ctx ) if (ctx->Array.EdgeFlag.Enabled) { aa->array = &ctx->Array.EdgeFlag; - aa->func = (void (*)( const void * ))glEdgeFlagv; + aa->func = (array_func) glEdgeFlagv; aa++; } diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index 537f857d590..83fa89781be 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -1,10 +1,10 @@ -/* $Id: api_loopback.c,v 1.9.2.1 2001/12/20 15:29:15 keithw Exp $ */ +/* $Id: api_loopback.c,v 1.9.2.2 2002/01/15 20:17:59 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.2 * - * 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"), @@ -29,10 +29,10 @@ #include "glheader.h" +#include "glapi.h" #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 @@ -66,9 +66,9 @@ -#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) +#define FOGCOORDF(x) _glapi_Dispatch->FogCoordfEXT(x) +#define SECONDARYCOLORUB(a,b,c) _glapi_Dispatch->SecondaryColor3ubEXT(a,b,c) +#define SECONDARYCOLORF(a,b,c) _glapi_Dispatch->SecondaryColor3fEXT(a,b,c) static void diff --git a/src/mesa/tnl/t_imm_dlist.c b/src/mesa/tnl/t_imm_dlist.c index 606e0f09cf4..fc2b1cb594d 100644 --- a/src/mesa/tnl/t_imm_dlist.c +++ b/src/mesa/tnl/t_imm_dlist.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_dlist.c,v 1.29.2.5 2001/12/20 15:29:16 keithw Exp $ */ +/* $Id: t_imm_dlist.c,v 1.29.2.6 2002/01/15 20:18:00 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,7 +29,6 @@ #include "glheader.h" -#include "api_compat.h" #include "context.h" #include "dlist.h" #include "debug.h" @@ -621,10 +620,10 @@ static void loopback_compiled_cassette( GLcontext *ctx, struct immediate *IM ) } if (flags[i] & VERT_SPEC_RGB) - _compat_SecondaryColor3fvEXT( IM->SecondaryColor[i] ); + _glapi_Dispatch->SecondaryColor3fvEXT( IM->SecondaryColor[i] ); if (flags[i] & VERT_FOG_COORD) - _compat_FogCoordfEXT( IM->FogCoord[i] ); + _glapi_Dispatch->FogCoordfEXT( IM->FogCoord[i] ); if (flags[i] & VERT_INDEX) glIndexi( IM->Index[i] ); |