mirror of
https://github.com/Perlmint/glew-cmake.git
synced 2024-12-02 11:27:06 +00:00
7214d0be63
git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@233 783a27ee-832a-0410-bc00-9f386506c6dd
57 lines
1.3 KiB
C
57 lines
1.3 KiB
C
return GLEW_OK;
|
|
}
|
|
|
|
#endif /* _WIN32 */
|
|
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
const GLubyte* glewGetErrorString (GLenum error)
|
|
{
|
|
static const GLubyte* _glewErrorString[] =
|
|
{
|
|
(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"
|
|
};
|
|
const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1;
|
|
return _glewErrorString[(int)error > max_error ? max_error : (int)error];
|
|
}
|
|
|
|
const GLubyte* glewGetString (GLenum name)
|
|
{
|
|
static const GLubyte* _glewString[] =
|
|
{
|
|
(const GLubyte*)NULL,
|
|
(const GLubyte*)"GLEW_VERSION_STRING"
|
|
};
|
|
const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
|
|
return _glewString[(int)name > max_string ? 0 : (int)name];
|
|
}
|
|
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
GLboolean glewExperimental = GL_FALSE;
|
|
|
|
#ifndef GLEW_MX
|
|
|
|
GLenum glewInit ()
|
|
{
|
|
GLenum r;
|
|
if ( (r = glewContextInit()) ) return r;
|
|
#if defined(_WIN32)
|
|
return wglewContextInit();
|
|
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
|
|
return glxewContextInit();
|
|
#else
|
|
return r;
|
|
#endif /* _WIN32 */
|
|
}
|
|
|
|
#else
|
|
|
|
|
|
#endif
|
|
|