Esempio n. 1
0
/*
 * Search for name in the extensions string. Use of strstr()
 * is not sufficient because extension names can be prefixes of
 * other extension names. Could use strtok() but the constant
 * string returned by glGetString might be in read-only memory.
 */
static GLboolean _glewSearchExtension(const char *name, const GLubyte *start, const GLubyte *end) {
    const GLubyte *p;
    GLuint len = _glewStrLen((const GLubyte *) name);
    p = start;
    while (p < end) {
        GLuint n = _glewStrCLen(p, ' ');
        if (len == n && _glewStrSame((const GLubyte *) name, p, n)) return GL_TRUE;
        p += n + 1;
    }
    return GL_FALSE;
}
Esempio n. 2
0
/* 
 * Search for name in the extensions string. Use of strstr()
 * is not sufficient because extension names can be prefixes of
 * other extension names. Could use strtok() but the constant
 * string returned by glGetString might be in read-only memory.
 */
GLboolean glewGetExtension (const char* name)
{    
  GLubyte* p;
  GLubyte* end;
  GLuint len = _glewStrLen((const GLubyte*)name);
  p = (GLubyte*)glGetString(GL_EXTENSIONS);
  if (0 == p) return GL_FALSE;
  end = p + _glewStrLen(p);
  while (p < end)
  {
    GLuint n = _glewStrCLen(p, ' ');
    if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
    p += n+1;
  }
  return GL_FALSE;
}