[PyOpenGL-Devel] OpenGL 3.2 core profile
Brought to you by:
mcfletch
|
From: Gregor T. <gre...@gm...> - 2012-01-08 21:00:08
|
Hi,
first thanks to Mike Fletcher for creating this wonderful package!
I want to make use of the new OpenGL 3.2 core profile implementation on OS X 10.7 Lion. Now I experience some problems with PyOpenGL 3.0.2a, e.g. when I want to use glGenVertexArrays.
I could track some of the problems to the function 'hasGLExtension' in OpenGL/extensions.py, here the problematic lines:
try:
AVAILABLE_GL_EXTENSIONS[:] = glGetString( GL_EXTENSIONS ).split()
except error.GLError, err:
# OpenGL 3.0 deprecates glGetString( GL_EXTENSIONS )
from OpenGL.GL import GL_NUM_EXTENSIONS, glGetStringi, glGetIntegerv
count = glGetIntegerv( GL_NUM_EXTENSIONS )
for i in range( count ):
AVAILABLE_GL_EXTENSIONS.append(
glGetStringi( GL_EXTENSIONS, i )
)
result = specifier in AVAILABLE_GL_EXTENSIONS
1) glGetString(GL_EXTENSIONS) returns NULL, split() then throws an AttributeError.
I observed (with GL Profiler) that there is no error check (call of GetError after GetString), therefore the next GL function call fails with a false error.
2) later, GetStringi( GL_EXTENSIONS, i) produces an OpenGL.arrays.arraydatatype.GLubyteArray instead of a bytes string, which gives always a False result in the last line.
To fix this I duplicated in OpenGL/glget.py the code for glGetString accordingly for glGetStringi, and changed the import statement above to use this definition.
3) For glGenVertexArrays PyOpenGL expects that the extension GL_ARB_vertex_array_object is available. However, this extension is not present since glGenVertexArrays is part of OpenGL 3.0 (and 3.2 core profile). Here I am stuck, I don't know how to fix this (and for other related GL functions)
Please, I need help to proceed with these problems.
Gregor |