X-Git-Url: https://git.cworth.org/git?p=glenv;a=blobdiff_plain;f=glenv.c;h=d5ec2e8735457a7bc80a6fcd7671f875cd23886b;hp=76f669334eba354d270fafd752576fcee0704587;hb=07eb5e7a7a1098297bc49f822bb78c293980c02e;hpb=25190a5158256abe6be58bdb2065ed7f6a403fa5 diff --git a/glenv.c b/glenv.c index 76f6693..d5ec2e8 100644 --- 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. */