#include #include #include #include #if defined(_WIN32) #include #elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) #include #endif #if defined(__APPLE__) #include #endif #ifdef GLEW_REGAL #include #endif static FILE* f; #ifdef GLEW_MX GLEWContext _glewctx; #define glewGetContext() (&_glewctx) #ifdef _WIN32 WGLEWContext _wglewctx; #define wglewGetContext() (&_wglewctx) #elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) GLXEWContext _glxewctx; #define glxewGetContext() (&_glxewctx) #endif #endif /* Command-line parameters for GL context creation */ struct createParams { #if 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 */ }; GLboolean glewCreateContext (struct createParams *params); GLboolean glewParseArgs (int argc, char** argv, struct createParams *); void glewDestroyContext (); /* ------------------------------------------------------------------------- */ static void 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