From 21ab2588217e89f950bff32c386525292f9f773e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 17 Feb 2000 20:53:48 +0000 Subject: removed driver RendererString() and ExtensionString() funcs --- src/mesa/main/get.c | 59 ++++++++++++++++++++--------------------------------- 1 file changed, 22 insertions(+), 37 deletions(-) (limited to 'src/mesa/main/get.c') diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index ed0ba23da8..924f75a74c 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1,4 +1,4 @@ -/* $Id: get.c,v 1.12 2000/02/06 03:03:02 brianp Exp $ */ +/* $Id: get.c,v 1.13 2000/02/17 20:53:48 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -3933,47 +3933,32 @@ const GLubyte * _mesa_GetString( GLenum name ) { GET_CURRENT_CONTEXT(ctx); - static char result[1000]; static char *vendor = "Brian Paul"; + static char *renderer = "Mesa"; static char *version = "1.2 Mesa 3.3 beta"; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0); - /* First see if device driver can satisfy this call */ - switch (name) { - case GL_VENDOR: - case GL_RENDERER: - case GL_VERSION: - if (ctx->Driver.GetString) { - const GLubyte *str = (*ctx->Driver.GetString)(ctx, name); - if (str && str[0]) - return str; - } - break; - /* Extensions always handled by extensions.c */ - case GL_EXTENSIONS: - return (GLubyte *) gl_extensions_get_string( ctx ); - default: - gl_error( ctx, GL_INVALID_ENUM, "glGetString" ); - return (GLubyte *) 0; - } - - /* If we get here, device driver didn't return a string */ - switch (name) { - case GL_VENDOR: - return (GLubyte *) vendor; - case GL_RENDERER: - strcpy(result, "Mesa"); - if (ctx->Driver.RendererString) { - strcat(result, " "); - strcat(result, (*ctx->Driver.RendererString)()); - } - return (GLubyte *) result; - case GL_VERSION: - return (GLubyte *) version; - default: - /* caught above */ - return NULL; + /* this is a required driver function */ + assert(ctx->Driver.GetString); + { + const GLubyte *str = (*ctx->Driver.GetString)(ctx, name); + if (str) + return str; + + switch (name) { + case GL_VENDOR: + return (const GLubyte *) vendor; + case GL_RENDERER: + return (const GLubyte *) renderer; + case GL_VERSION: + return (const GLubyte *) version; + case GL_EXTENSIONS: + return (GLubyte *) gl_extensions_get_string( ctx ); + default: + gl_error( ctx, GL_INVALID_ENUM, "glGetString" ); + return (GLubyte *) 0; + } } } -- cgit v1.2.3