Greg Ewing wrote:
> k0wax wrote:
>
>> How can I import all constants from OpenGL.GL without importing all
>> functions? (from OpenGL.GL import *)
>>
>
> Maybe something like
>
> g = globals()
> for name, value in OpenGL.GL.__dict__.items():
> if name == name.upper():
> g[name] = value
>
If the goal is just to get the constants (and you don't care about
loading the functions as you do so):
from OpenGL.raw.GL.constants import *
will work with PyOpenGL 3.x. You will, however, miss the "alias"
entries from the header file. You're also going to have all the
initialisation overhead of creating the functions, as they are created
when OpenGL.raw.GL is imported in importing the final module.
HTH,
Mike
--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
|