Re: [PyOpenGL-Users] glGenVertexArrays missing with Python 3
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2013-05-01 15:20:16
|
On 13-05-01 02:36 AM, Tom Goddard wrote: > I'm using an OpenGL 3.2 context (core profile) on Mac 10.8.3 and I find that bool(OpenGL.GL.glGenVertexArrays) is False when I use Python 3.3.1 and True when I use Python 2.7.4. Since glGenVertexArrays is core in OpenGL 3.0 there is something wrong when using PyOpenGL with Python 3.3.1. I observe this using PyOpenGL bzr head source code from April 29, 2013 and am using PyQt4 and Qt 5.0.2. > > Some digging reveals that the bug is in PyOpenGL file OpenGL/extensions.py and is caused by the AVAILABLE_GL_EXTENSIONS variable in that file containing a list that includes some extension names as strings and some as Python 3 bytearrays. The code that checks if glGenVertexArrays is available looks to see if the byte array b"glGenVertexArrays" is in AVAILABLE_GL_EXTENSIONS but it does not find it. The string "glGenVertexArrays" is in that list but bytearrays are never equal to strings in Python 3. This bug results in all the extensions listed in VERSION_EXTENSIONS in extensions.py not being found. A change in one line fixes the bug and is provided in the attached patch. I hope this can be part of the next PyOpenGL release. > > With this patch PyOpenGL is working nicely with a Mac OpenGL 3.2 core profile context and Python 3.3.1 using GLSL version 150 shaders, vertex buffers and vertex array objects showing surfaces, meshes, and textures in a molecular visualization program I am developing (next generation of UCSF Chimera). Thanks Tom, patch is integrated into bzr head and will show up with the next release. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |