2003-07-06 15:01:13 +00:00
|
|
|
#include <stdio.h>
|
2004-02-01 21:26:11 +00:00
|
|
|
#include <stdlib.h>
|
2003-07-06 15:01:13 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <GL/glew.h>
|
2003-10-27 02:34:05 +00:00
|
|
|
#if defined(_WIN32)
|
2003-07-06 15:01:13 +00:00
|
|
|
#include <GL/wglew.h>
|
2013-12-09 21:20:56 +00:00
|
|
|
#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
2003-07-06 15:01:13 +00:00
|
|
|
#include <GL/glxew.h>
|
2003-09-26 13:49:28 +00:00
|
|
|
#endif
|
|
|
|
|
2012-07-23 21:19:50 +00:00
|
|
|
#ifdef GLEW_REGAL
|
|
|
|
#include <GL/Regal.h>
|
|
|
|
#endif
|
|
|
|
|
2003-07-06 15:01:13 +00:00
|
|
|
static FILE* f;
|
|
|
|
|
2004-05-09 09:08:20 +00:00
|
|
|
#ifdef GLEW_MX
|
2004-05-09 09:26:51 +00:00
|
|
|
GLEWContext _glewctx;
|
|
|
|
#define glewGetContext() (&_glewctx)
|
|
|
|
#ifdef _WIN32
|
|
|
|
WGLEWContext _wglewctx;
|
|
|
|
#define wglewGetContext() (&_wglewctx)
|
2013-12-09 21:20:56 +00:00
|
|
|
#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
2004-05-09 09:26:51 +00:00
|
|
|
GLXEWContext _glxewctx;
|
|
|
|
#define glxewGetContext() (&_glxewctx)
|
|
|
|
#endif
|
2004-05-09 09:08:20 +00:00
|
|
|
#endif
|
|
|
|
|
2004-02-02 02:25:18 +00:00
|
|
|
#if defined(_WIN32)
|
|
|
|
GLboolean glewCreateContext (int* pixelformat);
|
2013-12-09 21:20:56 +00:00
|
|
|
#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
2004-02-01 21:26:11 +00:00
|
|
|
GLboolean glewCreateContext (const char* display, int* visual);
|
2004-02-02 02:25:18 +00:00
|
|
|
#else
|
|
|
|
GLboolean glewCreateContext ();
|
|
|
|
#endif
|
|
|
|
|
2004-02-02 02:30:43 +00:00
|
|
|
#if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
2004-02-01 21:26:11 +00:00
|
|
|
GLboolean glewParseArgs (int argc, char** argv, char** display, int* visual);
|
2004-02-02 02:30:43 +00:00
|
|
|
#endif
|
|
|
|
|
2003-09-26 13:49:28 +00:00
|
|
|
void glewDestroyContext ();
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
|
2006-11-21 04:13:59 +00:00
|
|
|
static void glewPrintExt (const char* name, GLboolean def1, GLboolean def2, GLboolean def3)
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
fprintf(f, "\n%s:", name);
|
2004-02-02 03:03:13 +00:00
|
|
|
for (i=0; i<62-strlen(name); i++) fprintf(f, " ");
|
2003-10-27 03:11:08 +00:00
|
|
|
fprintf(f, "%s ", def1 ? "OK" : "MISSING");
|
|
|
|
if (def1 != def2)
|
2006-11-21 04:13:59 +00:00
|
|
|
fprintf(f, "[%s] ", def2 ? "OK" : "MISSING");
|
|
|
|
if (def1 != def3)
|
|
|
|
fprintf(f, "[%s]\n", def3 ? "OK" : "MISSING");
|
2003-10-27 03:11:08 +00:00
|
|
|
else
|
|
|
|
fprintf(f, "\n");
|
2004-02-02 03:03:13 +00:00
|
|
|
for (i=0; i<strlen(name)+1; i++) fprintf(f, "-");
|
2003-07-06 15:01:13 +00:00
|
|
|
fprintf(f, "\n");
|
|
|
|
fflush(f);
|
|
|
|
}
|
|
|
|
|
2004-02-02 03:03:13 +00:00
|
|
|
static void glewInfoFunc (const char* name, GLint undefined)
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
fprintf(f, " %s:", name);
|
2004-02-02 03:03:13 +00:00
|
|
|
for (i=0; i<60-strlen(name); i++) fprintf(f, " ");
|
2003-07-06 15:01:13 +00:00
|
|
|
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)
|
|
|
|
{
|
2006-11-21 04:13:59 +00:00
|
|
|
glewPrintExt("GL_VERSION_1_1", GLEW_VERSION_1_1, GLEW_VERSION_1_1, GLEW_VERSION_1_1);
|
2003-07-06 15:01:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* GL_VERSION_1_1 */
|
|
|
|
|