diff options
author | jjesswan <jessica_wan@brown.edu> | 2024-04-22 21:56:26 -0400 |
---|---|---|
committer | jjesswan <jessica_wan@brown.edu> | 2024-04-22 21:56:26 -0400 |
commit | a556b45abf18f1bd509daaf63b66b7d55e9fd291 (patch) | |
tree | bc9b8a2d184c12aee236e7f9f276a34b84ca552d /engine-ocean/External/glew/auto/src/glewinfo_head.c | |
parent | cd7c76017a12bb548036571c1ff13e551369d06d (diff) |
add engine version
Diffstat (limited to 'engine-ocean/External/glew/auto/src/glewinfo_head.c')
-rw-r--r-- | engine-ocean/External/glew/auto/src/glewinfo_head.c | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/engine-ocean/External/glew/auto/src/glewinfo_head.c b/engine-ocean/External/glew/auto/src/glewinfo_head.c new file mode 100644 index 0000000..79ed785 --- /dev/null +++ b/engine-ocean/External/glew/auto/src/glewinfo_head.c @@ -0,0 +1,96 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <GL/glew.h> +#if defined(GLEW_EGL) +#include <GL/eglew.h> +#elif defined(GLEW_OSMESA) +#define GLAPI extern +#include <GL/osmesa.h> +#elif defined(_WIN32) +#include <GL/wglew.h> +#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) +#include <GL/glxew.h> +#endif + +#if defined(__APPLE__) +#include <AvailabilityMacros.h> +#endif + +#ifdef GLEW_REGAL +#include <GL/Regal.h> +#endif + +static FILE* f; + +/* Command-line parameters for GL context creation */ + +struct createParams +{ +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) +#elif defined(_WIN32) + int pixelformat; +#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) + const char* display; + int visual; +#endif + int major, minor; /* GL context version number */ + + /* https://www.opengl.org/registry/specs/ARB/glx_create_context.txt */ + int profile; /* core = 1, compatibility = 2 */ + int flags; /* debug = 1, forward compatible = 2 */ + + /* GLEW experimental mode */ + int experimental; +}; + +GLboolean glewCreateContext (struct createParams *params); + +GLboolean glewParseArgs (int argc, char** argv, struct createParams *); + +void glewDestroyContext (); + +/* ------------------------------------------------------------------------- */ + +static GLboolean glewPrintExt (const char* name, GLboolean def1, GLboolean def2, GLboolean def3) +{ + unsigned int i; + fprintf(f, "\n%s:", name); + for (i=0; i<62-strlen(name); i++) fprintf(f, " "); + fprintf(f, "%s ", def1 ? "OK" : "MISSING"); + if (def1 != def2) + fprintf(f, "[%s] ", def2 ? "OK" : "MISSING"); + if (def1 != def3) + fprintf(f, "[%s]\n", def3 ? "OK" : "MISSING"); + else + fprintf(f, "\n"); + for (i=0; i<strlen(name)+1; i++) fprintf(f, "-"); + fprintf(f, "\n"); + fflush(f); + return def1 || def2 || def3 || glewExperimental; /* Enable per-function info too? */ +} + +static void glewInfoFunc (GLboolean fi, const char* name, GLint undefined) +{ + unsigned int i; + if (fi) + { + fprintf(f, " %s:", name); + for (i=0; i<60-strlen(name); i++) fprintf(f, " "); + fprintf(f, "%s\n", undefined ? "MISSING" : "OK"); + fflush(f); + } +} + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifdef GL_VERSION_1_1 + +static void _glewInfo_GL_VERSION_1_1 (void) +{ + glewPrintExt("GL_VERSION_1_1", GLEW_VERSION_1_1, GLEW_VERSION_1_1, GLEW_VERSION_1_1); +} + +#endif /* GL_VERSION_1_1 */ + |