Re: [PyOpenGL-Users] Missing definitions? GLbyte, GL_R8UI
Brought to you by:
mcfletch
From: Ian M. <ia...@ge...> - 2014-01-06 09:05:55
|
On Sun, Jan 5, 2014 at 1:32 AM, Carl Olsson <car...@gm...> wrote: > I've just started using PyOpenGL and I've come across a couple of > definitions that I can't find anywhere. > I'm using PyOpenGL 3.1a1 with Python 3.3. > > The culprits are: > GL_R8UI (sized internal format enum) > GLbyte (type) > > Have I missed importing a package? My PyOpenGL related imports: > import OpenGL > OpenGL. > FORWARD_COMPATIBLE_ONLY = True > OpenGL.ERROR_ON_COPY = True > from OpenGL.GL import * > from OpenGL.arrays import vbo > from OpenGL.GL import shaders I don't know if this is correct, but my guess is that, since this came from an extension <http://www.opengl.org/registry/specs/ARB/texture_rg.txt>, you will either need to use OpenGL 3.0+ or load the extension. For the latter, while I haven't used PyOpenGL for my low-level graphics work in years, but my *guess* would be that "from OpenGL.GL.ARB.texture_rg import *" would work (for me, at least, that loads the required symbol). Regarding "GLbyte", that sounds like a C typedef. Passing integers instead probably will work fine because of PyOpenGL's wrapping, and the associated token for data is "GL_BYTE". For specifics, code would also be helpful. Note also regarding forward compatibility that the consensus seems to be not to use it (e.g.<http://www.opengl.org/wiki/Creating_an_OpenGL_Context_%28WGL%29#Create_Context_with_Attributes>). I don't know that much about it myself, but I suspect that outside of portability conformance testing, the flag has little modern use. All that said, if, in addition to PyOpenGL, you're new to OpenGL concepts in general, you probably don't want GL_R8UI or other similar integer-texture tokens anyway, as they're generally only useful for creating shader mutex textures or other monstrosities for advanced shading techniques. At the risk of self-promotion, I humbly present my PyOpenGL basecode<http://geometrian.com/programming/tutorials/OpenGL%20Program%20Shell.py.txt>as a well-tested, simple starting point for learning PyOpenGL. Good luck, Ian |