|
kusano |
7d535a |
/* ------------------------------------------------------------------------ */
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error)
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
static const GLubyte* _glewErrorString[] =
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
(const GLubyte*)"No error",
|
|
kusano |
7d535a |
(const GLubyte*)"Missing GL version",
|
|
kusano |
7d535a |
(const GLubyte*)"GL 1.1 and up are not supported",
|
|
kusano |
7d535a |
(const GLubyte*)"GLX 1.2 and up are not supported",
|
|
kusano |
7d535a |
(const GLubyte*)"Unknown error"
|
|
kusano |
7d535a |
};
|
|
kusano |
7d535a |
const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1;
|
|
kusano |
7d535a |
return _glewErrorString[(int)error > max_error ? max_error : (int)error];
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
const GLubyte * GLEWAPIENTRY glewGetString (GLenum name)
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
static const GLubyte* _glewString[] =
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
(const GLubyte*)NULL,
|
|
kusano |
7d535a |
(const GLubyte*)"GLEW_VERSION_STRING",
|
|
kusano |
7d535a |
(const GLubyte*)"GLEW_VERSION_MAJOR_STRING",
|
|
kusano |
7d535a |
(const GLubyte*)"GLEW_VERSION_MINOR_STRING",
|
|
kusano |
7d535a |
(const GLubyte*)"GLEW_VERSION_MICRO_STRING"
|
|
kusano |
7d535a |
};
|
|
kusano |
7d535a |
const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
|
|
kusano |
7d535a |
return _glewString[(int)name > max_string ? 0 : (int)name];
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* ------------------------------------------------------------------------ */
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
GLboolean glewExperimental = GL_FALSE;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#if !defined(GLEW_MX)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#if defined(_WIN32)
|
|
kusano |
7d535a |
extern GLenum GLEWAPIENTRY wglewContextInit (void);
|
|
kusano |
7d535a |
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
|
|
kusano |
7d535a |
extern GLenum GLEWAPIENTRY glxewContextInit (void);
|
|
kusano |
7d535a |
#endif /* _WIN32 */
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
GLenum GLEWAPIENTRY glewInit (void)
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
GLenum r;
|
|
kusano |
7d535a |
r = glewContextInit();
|
|
kusano |
7d535a |
if ( r != 0 ) return r;
|
|
kusano |
7d535a |
#if defined(_WIN32)
|
|
kusano |
7d535a |
return wglewContextInit();
|
|
kusano |
7d535a |
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */
|
|
kusano |
7d535a |
return glxewContextInit();
|
|
kusano |
7d535a |
#else
|
|
kusano |
7d535a |
return r;
|
|
kusano |
7d535a |
#endif /* _WIN32 */
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#endif /* !GLEW_MX */
|