#124 Extension check incorrect for pure OGL3

2.0.0
closed
API (59)
3
2016-02-06
2010-02-27
Anonymous
No

If a pure OpenGL 3.2 context is created, the extension check as it stands will simply generate a long list of invalid enum errors.

As discussed here:
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=245775

I propose similar code to the mentioned in that thread be added to glewGetExtension if OpenGL 3.0 or greater is supported:
(please test - as I have just typed this without even a compile)

GLboolean glewGetExtension (const char name)
{
GLuint len = _glewStrLen((const GLubyte
)name);

/ OpenGL 3.0 has a new extension mechanism /
if(GLEW_VERSION_3_0)
{
GLint n = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &n);
for (GLint i = 0; i < n; i++)
{
if(_glewStrSame((const GLubyte)name, glGetStringi(GL_EXTENSIONS, i), len))
{
return TRUE;
}
}
}
else
{
GLubyte
p;
GLubyte end;
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;
}

Discussion

  • Nigel Stewart

    Nigel Stewart - 2010-02-28

    Thanks for the report.
    Seems to be a duplicate of 2927731.
    The additional info is still welcome.

     
  • Nigel Stewart

    Nigel Stewart - 2015-02-19
    • assigned_to: Nigel Stewart
    • Group: --> 2.0.0
     
  • Nigel Stewart

    Nigel Stewart - 2016-02-06
    • status: open --> closed