Re: [PyOpenGL-Users] Enums from extensions
Brought to you by:
mcfletch
From: JoN <jo...@we...> - 2006-10-19 01:17:30
|
Allen, Hi I have the same question regarding enums, it seems you have to, at the mo= ment, find their hex values in the system's include files and manually declare = them in your Python code. Regarding the newer OpenGL extensions you were asking about: I'm no expert and am scrambling for a foothold on the GL/Python learning = curve myself, but this is what (I _think_) I've gleaned so far: GlewPy has been the traditional way of getting at the extensions, and the author/s is always adding new extension access. However, with the advent of Python ctypes (now included by default in 2.5= , that correct?), you can access the calls in the shared libraries (.so's on uni= xen like Linux, .dll's on windoze) directly, though you have to wrap your hea= d around how ctypes works. This allows you to at least connect in the ARB extensions for the 'good s= tuff', say if you are stuck with OpenGL 1.5, or get the new function calls from = OpenGL 2.0 and up. And yes, exactly as you say, you can write wrapper code that makes Python= adapt on the fly to whatever version of OpenGL is present. Some good stuff on doing that is at the GLSL tutorial (Ok its for C but t= he calls still apply) at LightHouse3d: http://www.lighthouse3d.com/opengl/glsl/index.php?ogloverview Now -=20 The following is an excellent example from PyGame, that uses ctypes to ac= cess the fragment shaders and compile and run GLSL code on the GPU: http://www.pygame.org/wiki/GLSLExample This example works, I've got it running and have spoken to the author and= gone further and got texturing working in the fragment shader from Python. As examples of OpenGL access from Python go, thats reasonably close to 'S= tate Of The Art' technology for modern cards! Highly recommend also joining the pygame users mailing list (see above si= te), I've got some very good info off people there so far. Hope all that is of some use to you! Jon Quoting Allen Bierbaum <abi...@gm...>: > I see in the documentation how I could import an extension and > initialize it, but how do I get the enums from an extension? For > example right now I would like to use GL_DEPTH_COMPONENT24 in my code > but I don't know how to get that from PyOpenGL. >=20 > Any ideas? >=20 > Also, this may have been asked before, but are there any plans to make > it easier to use the newer "extension" features of OpenGL? With the > dynamic nature of python it seems like it would be possible to have > PyOpenGL dynamically adapt it's interface to any given version of > OpenGL on the fly. For example asking PyOpenGL to present the > standard interface for OpenGL 2.0 it could go out and find any of the > needed extensions and name them like they are in the 2.0 spec. This > would be a great feature and would be unique to PyOpenGL since it > can't be done in C or C++. >=20 > Thanks, > Allen >=20 > -----------------------------------------------------------------------= -- > Using Tomcat but need to do more? Need to support web services, securit= y? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron= imo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users >=20 -------------------------------------------------------------------- Come and visit Web Prophets Website at http://www.webprophets.net.au |