Commit 271abde7 authored by idr's avatar idr
Browse files

Change the way glGetString(GL_EXTENSIONS) works so that

__glXGLClientVersion is not needed.
parent af4c1749
...@@ -821,7 +821,6 @@ extern char *__glXInternalQueryServerString( Display *dpy, int opcode, ...@@ -821,7 +821,6 @@ extern char *__glXInternalQueryServerString( Display *dpy, int opcode,
extern char *__glXstrdup(const char *str); extern char *__glXstrdup(const char *str);
extern const char __glXGLClientVersion[];
extern const char __glXGLClientExtensions[]; extern const char __glXGLClientExtensions[];
extern char *__glXCombineExtensionStrings( const char *cext_string, extern char *__glXCombineExtensionStrings( const char *cext_string,
const char *sext_string ); const char *sext_string );
......
...@@ -172,11 +172,6 @@ const char __glXGLClientExtensions[] = ...@@ -172,11 +172,6 @@ const char __glXGLClientExtensions[] =
static const char __glXGLXClientVendorName[] = "SGI"; static const char __glXGLXClientVendorName[] = "SGI";
static const char __glXGLXClientVersion[] = "1.4"; static const char __glXGLXClientVersion[] = "1.4";
/**
* Textual version of the client-side GL core version. This version is
* primarilly determined by what functionality has implemented protocol.
*/
const char __glXGLClientVersion[] = "1.2";
#ifdef GLX_DIRECT_RENDERING #ifdef GLX_DIRECT_RENDERING
#include "xf86dri.h" #include "xf86dri.h"
......
...@@ -963,8 +963,14 @@ const GLubyte *glGetString(GLenum name) ...@@ -963,8 +963,14 @@ const GLubyte *glGetString(GLenum name)
gc->version = s; gc->version = s;
} }
else { else {
gc->version = Xmalloc( strlen(__glXGLClientVersion) /* Allow 7 bytes for the client-side GL version. This allows
+ strlen((char *)s) + 4 ); * for upto version 999.999. I'm not holding my breath for
* that one! The extra 4 is for the ' ()\0' that will be
* added.
*/
const size_t size = 7 + strlen( (char *) s ) + 4;
gc->version = Xmalloc( size );
if ( gc->version == NULL ) { if ( gc->version == NULL ) {
/* If we couldn't allocate memory for the new string, /* If we couldn't allocate memory for the new string,
* make a best-effort and just copy the client-side version * make a best-effort and just copy the client-side version
...@@ -973,10 +979,13 @@ const GLubyte *glGetString(GLenum name) ...@@ -973,10 +979,13 @@ const GLubyte *glGetString(GLenum name)
* for a short string, the system is probably going to die * for a short string, the system is probably going to die
* soon anyway. * soon anyway.
*/ */
strcpy((char *)s, __glXGLClientVersion); snprintf( (char *) s, strlen( (char *) s ) + 1, "%u.%u",
client_major, client_minor );
gc->version = s;
} }
else { else {
sprintf( (char *)gc->version, "%s (%s)", __glXGLClientVersion, s ); snprintf( (char *)gc->version, size, "%u.%u (%s)",
client_major, client_minor, s );
Xfree( s ); Xfree( s );
s = gc->version; s = gc->version;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment