Another round of glRead/DrawBuffer() clean-ups and simplifications.
Replaced ctx->Color._DriverDrawBuffer with swrast->CurrentBuffer.
Replaced ctx->Pixel._DriverReadBuffer with ctx->Pixel._ReadSrcMask.
swrast->Driver.SetBuffer() takes FRONT/BACK_LEFT/RIGHT_BIT values now.
Added tokens and code for GL_AUX buffers, for completeness.
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index b0d26fd..acfd618 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -1,4 +1,4 @@
-/* $Id: glapi.c,v 1.64 2002/10/02 01:51:44 brianp Exp $ */
+/* $Id: glapi.c,v 1.65 2002/10/11 17:41:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -653,6 +653,10 @@
GLboolean
_glapi_add_entrypoint(const char *funcName, GLuint offset)
{
+ /* trivial rejection test */
+ if (!funcName || funcName[0] != 'g' || funcName[1] != 'l')
+ return GL_FALSE;
+
/* first check if the named function is already statically present */
{
GLint index = get_static_proc_offset(funcName);
@@ -661,13 +665,6 @@
}
}
- /* make sure this offset/name pair is legal (this isn't really needed) */
- {
- const char *name = _glapi_get_proc_name(offset);
- if (name && strcmp(name, funcName) != 0)
- return GL_FALSE; /* bad name! */
- }
-
/* See if this function has already been dynamically added */
{
GLuint i;
@@ -691,29 +688,29 @@
}
}
}
-
- /* This is a new function, try to add it. */
- if (NumExtEntryPoints >= MAX_EXTENSION_FUNCS ||
- offset >= DISPATCH_TABLE_SIZE) {
- /* No space left */
- return GL_FALSE;
- }
- else {
- void *entrypoint = generate_entrypoint(offset);
- if (!entrypoint)
- return GL_FALSE; /* couldn't generate assembly */
-
- /* OK! */
- ExtEntryTable[NumExtEntryPoints].Name = str_dup(funcName);
- ExtEntryTable[NumExtEntryPoints].Offset = offset;
- ExtEntryTable[NumExtEntryPoints].Address = entrypoint;
- NumExtEntryPoints++;
-
- return GL_TRUE; /* success */
- }
}
- /* should never get here, but play it safe */
+ /* This is a new function, try to add it. */
+ if (NumExtEntryPoints >= MAX_EXTENSION_FUNCS ||
+ offset >= DISPATCH_TABLE_SIZE) {
+ /* No space left */
+ return GL_FALSE;
+ }
+ else {
+ void *entrypoint = generate_entrypoint(offset);
+ if (!entrypoint)
+ return GL_FALSE; /* couldn't generate assembly */
+
+ /* OK! */
+ ExtEntryTable[NumExtEntryPoints].Name = str_dup(funcName);
+ ExtEntryTable[NumExtEntryPoints].Offset = offset;
+ ExtEntryTable[NumExtEntryPoints].Address = entrypoint;
+ NumExtEntryPoints++;
+
+ return GL_TRUE; /* success */
+ }
+
+ /* should never get here, silence compiler warnings */
return GL_FALSE;
}