summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-10-11 17:41:03 +0000
committerBrian Paul <[email protected]>2002-10-11 17:41:03 +0000
commit8ad1076dc2afda8ed37e5a9f6a757583eba90375 (patch)
tree30bc52e2db6e089972d441a53c070e8377cb684d /src/mesa/glapi
parent9e84910749744efcba06670f622cc00d279f26f1 (diff)
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.
Diffstat (limited to 'src/mesa/glapi')
-rw-r--r--src/mesa/glapi/glapi.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index b0d26fdcdd9..acfd6181f2f 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 @@ fill_in_entrypoint_offset(void *entrypoint, GLuint offset)
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 @@ _glapi_add_entrypoint(const char *funcName, GLuint offset)
}
}
- /* 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 @@ _glapi_add_entrypoint(const char *funcName, GLuint offset)
}
}
}
+ }
- /* 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 */
+ /* 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++;
+ /* OK! */
+ ExtEntryTable[NumExtEntryPoints].Name = str_dup(funcName);
+ ExtEntryTable[NumExtEntryPoints].Offset = offset;
+ ExtEntryTable[NumExtEntryPoints].Address = entrypoint;
+ NumExtEntryPoints++;
- return GL_TRUE; /* success */
- }
+ return GL_TRUE; /* success */
}
- /* should never get here, but play it safe */
+ /* should never get here, silence compiler warnings */
return GL_FALSE;
}