]> git.cworth.org Git - glenv/blobdiff - glenv.c
Implement all the extension-related options of glenv
[glenv] / glenv.c
diff --git a/glenv.c b/glenv.c
index 76f669334eba354d270fafd752576fcee0704587..d5ec2e8735457a7bc80a6fcd7671f875cd23886b 100644 (file)
--- a/glenv.c
+++ b/glenv.c
@@ -41,10 +41,11 @@ typedef struct options {
 static void
 export_options (options_t *options)
 {
-       if (options->query) {
-               glaze_set_first_gl_call_callback ("glenv_query");
-       }
-
+       if (options->query)
+               setenv ("GLENV_QUERY", "1", 1);
+       else
+               unsetenv ("GLENV_QUERY");
+               
        if (options->vendor)
                setenv ("GLENV_GL_VENDOR", options->vendor, 1);
        else
@@ -67,19 +68,19 @@ export_options (options_t *options)
                unsetenv ("GLENV_GL_SHADING_LANGUAGE_VERSION");
 
        if (options->extensions)
-               setenv ("GLENV_EXTENSIONS", options->extensions, 1);
+               setenv ("GLENV_GL_EXTENSIONS", options->extensions, 1);
        else
-               unsetenv ("GLENV_EXTENSIONS");
+               unsetenv ("GLENV_GL_EXTENSIONS");
 
        if (options->extensions_whitelist)
-               setenv ("GLENV_EXTENSIONS_WHITELIST", options->extensions_whitelist, 1);
+               setenv ("GLENV_GL_EXTENSIONS_WHITELIST", options->extensions_whitelist, 1);
        else
-               unsetenv ("GLENV_EXTENSIONS_WHITELIST");
+               unsetenv ("GLENV_GL_EXTENSIONS_WHITELIST");
 
        if (options->extensions_blacklist)
-               setenv ("GLENV_EXTENSIONS_BLACKLIST", options->extensions_blacklist, 1);
+               setenv ("GLENV_GL_EXTENSIONS_BLACKLIST", options->extensions_blacklist, 1);
        else
-               unsetenv ("GLENV_EXTENSIONS_BLACKLIST");
+               unsetenv ("GLENV_GL_EXTENSIONS_BLACKLIST");
 }
 
 static void
@@ -215,6 +216,8 @@ main (int argc, char *argv[])
 
        export_options (&options);
 
+       glaze_set_first_gl_call_callback ("glenv_first_gl_call");
+
        glaze_execute (argc - optind, &argv[optind], "libglenv.so");
 
        /* If glaze_execute returns then something went wrong. */