This depends on the function recently added to glaze:
glaze_set_first_glcall_callback
So that once there's a valid GL context, glenv can query it to
determine the environment and report that.
static void
export_options (options_t *options)
{
- if (options->query)
- setenv ("GLENV_QUERY", "1", 1);
- else
- unsetenv ("GLENV_QUERY");
+ if (options->query) {
+ glaze_set_first_gl_call_callback ("glenv_query");
+ }
if (options->vendor)
setenv ("GLENV_GL_VENDOR", options->vendor, 1);
#include <stdlib.h>
#include <string.h>
+void glenv_query (void);
+
+typedef GLubyte * (get_string_type_t) (GLenum);
+
+void
+glenv_query (void)
+{
+ printf ("--vendor=\"%s\"\n", glGetString (GL_VENDOR));
+ printf ("--renderer=\"%s\"\n", glGetString (GL_RENDERER));
+ printf ("--version=\"%s\"\n", glGetString (GL_VERSION));
+ printf ("--shading-language-version=\"%s\"\n", glGetString (GL_SHADING_LANGUAGE_VERSION));
+ printf ("--extensions=\"%s\"\n", glGetString (GL_EXTENSIONS));
+
+ exit (0);
+}
+
static int
glenv_num_extensions (void)
{