Re: glGenVertexArrays missing with Python 3
"Mike C. Fletcher" <[email protected]> Wed, 01 May 2013 11:20:08 -0400
| Newsgroups | gmane.comp.python.opengl.user |
|---|---|
| Message-ID | <[email protected]> |
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 ------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with <2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 _______________________________________________ PyOpenGL Homepage http://pyopengl.sourceforge.net