diff options
author | marha <marha@users.sourceforge.net> | 2011-09-29 08:21:31 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-09-29 08:21:31 +0200 |
commit | bee9191042416cbfb848615189ca1e2a0069f022 (patch) | |
tree | 8f7b2d550ca61d7a6ff10d1fb513fff371268ee0 /mesalib/src/mesa/main/version.c | |
parent | 18a8f9f6839dfd899814a76a971e720c1e622236 (diff) | |
download | vcxsrv-bee9191042416cbfb848615189ca1e2a0069f022.tar.gz vcxsrv-bee9191042416cbfb848615189ca1e2a0069f022.tar.bz2 vcxsrv-bee9191042416cbfb848615189ca1e2a0069f022.zip |
xwininfo libXft mesa git update 29 sep 2011
Diffstat (limited to 'mesalib/src/mesa/main/version.c')
-rw-r--r-- | mesalib/src/mesa/main/version.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/mesalib/src/mesa/main/version.c b/mesalib/src/mesa/main/version.c index a5deeabd2..c49731747 100644 --- a/mesalib/src/mesa/main/version.c +++ b/mesalib/src/mesa/main/version.c @@ -44,7 +44,7 @@ override_version(struct gl_context *ctx, GLuint *major, GLuint *minor) return; } - n = sscanf(version, "%d.%d", major, minor); + n = sscanf(version, "%u.%u", major, minor); if (n != 2) { fprintf(stderr, "error: invalid value for %s: %s\n", env_var, version); return; @@ -52,6 +52,30 @@ override_version(struct gl_context *ctx, GLuint *major, GLuint *minor) } /** + * Override the context's GLSL version if the environment variable + * MESA_GLSL_VERSION_OVERRIDE is set. Valid values for + * MESA_GLSL_VERSION_OVERRIDE are integers, such as "130". + */ +void +_mesa_override_glsl_version(struct gl_context *ctx) +{ + const char *env_var = "MESA_GLSL_VERSION_OVERRIDE"; + const char *version; + int n; + + version = getenv(env_var); + if (!version) { + return; + } + + n = sscanf(version, "%u", &ctx->Const.GLSLVersion); + if (n != 1) { + fprintf(stderr, "error: invalid value for %s: %s\n", env_var, version); + return; + } +} + +/** * Examine enabled GL extensions to determine GL version. * Return major and minor version numbers. */ |