Re: [PyOpenGL-Users] Extensions, etc
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@ro...> - 2003-08-11 22:22:37
|
Brian Hammond wrote: >I am new to PyOpenGL and did not find much in the docs or archives on >OpenGL extensions. Specifically, how are new extensions added to >PyOpenGL? I would think a script (in Python) would be used to download >the specs from the registry, create the glue code, run Swig or whatever, >etc. Is this done now? Again, I am brand new (2 days) to PyOpenGL. > The process of wrapping trivial extensions (e.g. ones that are just collections of constants) is probably close to automatable. However, it's not currently automated. Feel free to contribute a script to do this :) . For most non-trivial extensions it's necessary to write an extension module .i file (swig interface file). Putting these into the correct directory (e.g. PyOpenGL2\interface\GL\ARB) of the source distribution will automatically build them. Writing the .i file is not a particularly difficult task (there's a lot of samples in the interface directories), but it requires effort by a developer for every extension so supported. Even more restrictively, it requires that the developer *have* that extension on their machine so that they can *test* it. My old Radeon 7500 has very few of the features required by OpenGL 1.2 and above (at least for the interesting extensions). There are two or three (interesting) extensions I have that aren't wrapped, but they haven't been interesting *enough* to get me to write the wrapper :) . >Also, as I understand it, PyOpenGL supports OpenGL 1.1 which >is quite old... Are there plans to update to say OpenGL 1.3? 1.4? > OpenGL 1.3 and 1.4 are just a collection of extensions to OpenGL 1.1, so it's really the same question. You could AFAIK write the entire OpenGL 1.3 or 1.4 extension-set on top of PyOpenGL 2.0.1 w/out needing to upgrade the core (unless you discover a bug in the process, of course). The only thing missing would be the names in the core name-space for the extension features. (Not sure if that holds for 2.0, however). That said, if new extensions are contributed back, we would probably do a point release to include it in the main package, so adding the names to the core namespace wouldn't be a real problem. Note: for any real-world programming these days, you'd need to take the extension-based approach anyway (since most users *don't* have OpenGL 1.3/1.4 drivers installed (I've never even *seen* one), and it will likely be a few years before they do (unless Microsoft decides to write one)). >Looks good though! > Thanks. Have fun, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |