2003-07-06 15:01:13 +00:00
|
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
|
2003-09-12 03:50:22 +00:00
|
|
|
const GLubyte* glewGetErrorString (GLenum error)
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
2003-09-12 03:50:22 +00:00
|
|
|
static const GLubyte* _glewErrorString[] =
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
2003-10-27 05:28:55 +00:00
|
|
|
(const GLubyte*)"No error",
|
|
|
|
(const GLubyte*)"Missing GL version",
|
|
|
|
(const GLubyte*)"GL 1.1 and up are not supported",
|
|
|
|
(const GLubyte*)"GLX 1.2 and up are not supported",
|
|
|
|
(const GLubyte*)"Unknown error"
|
2003-07-06 15:01:13 +00:00
|
|
|
};
|
2003-10-02 09:49:29 +00:00
|
|
|
const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1;
|
2003-10-03 06:44:07 +00:00
|
|
|
return _glewErrorString[(int)error > max_error ? max_error : (int)error];
|
2003-07-06 15:01:13 +00:00
|
|
|
}
|
|
|
|
|
2003-09-12 03:50:22 +00:00
|
|
|
const GLubyte* glewGetString (GLenum name)
|
|
|
|
{
|
|
|
|
static const GLubyte* _glewString[] =
|
|
|
|
{
|
2003-10-27 05:28:55 +00:00
|
|
|
(const GLubyte*)NULL,
|
2007-12-28 00:24:07 +00:00
|
|
|
(const GLubyte*)"GLEW_VERSION_STRING",
|
|
|
|
(const GLubyte*)"GLEW_VERSION_MAJOR_STRING",
|
|
|
|
(const GLubyte*)"GLEW_VERSION_MINOR_STRING",
|
|
|
|
(const GLubyte*)"GLEW_VERSION_MICRO_STRING"
|
2003-09-12 03:50:22 +00:00
|
|
|
};
|
2003-10-02 09:49:29 +00:00
|
|
|
const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
|
2003-10-03 06:44:07 +00:00
|
|
|
return _glewString[(int)name > max_string ? 0 : (int)name];
|
2003-09-12 03:50:22 +00:00
|
|
|
}
|
|
|
|
|
2003-07-06 15:01:13 +00:00
|
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
|
|
|
|
GLboolean glewExperimental = GL_FALSE;
|
|
|
|
|
2005-01-03 07:05:38 +00:00
|
|
|
#if !defined(GLEW_MX)
|
2004-02-19 04:37:07 +00:00
|
|
|
|
2004-12-29 05:43:35 +00:00
|
|
|
#if defined(_WIN32)
|
|
|
|
extern GLenum wglewContextInit (void);
|
|
|
|
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
|
|
|
|
extern GLenum glxewContextInit (void);
|
|
|
|
#endif /* _WIN32 */
|
|
|
|
|
2012-05-04 16:03:37 +00:00
|
|
|
GLenum glewInit (void)
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
2003-09-12 03:50:22 +00:00
|
|
|
GLenum r;
|
2012-05-04 16:03:37 +00:00
|
|
|
r = glewContextInit();
|
|
|
|
if ( r != 0 ) return r;
|
2003-10-27 01:06:34 +00:00
|
|
|
#if defined(_WIN32)
|
2004-02-19 07:49:16 +00:00
|
|
|
return wglewContextInit();
|
2003-10-27 01:06:34 +00:00
|
|
|
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
|
2004-02-19 07:49:16 +00:00
|
|
|
return glxewContextInit();
|
2003-10-27 01:06:34 +00:00
|
|
|
#else
|
|
|
|
return r;
|
2003-07-06 15:01:13 +00:00
|
|
|
#endif /* _WIN32 */
|
|
|
|
}
|
2004-02-19 04:37:07 +00:00
|
|
|
|
2005-01-03 07:05:38 +00:00
|
|
|
#endif /* !GLEW_MX */
|