Re: [PyOpenGL-Users] OpenGL 3x compatibility
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2009-12-09 05:42:20
|
Prashant Saxena wrote: > Hi, > > I am re-writing an old application using Python/PyOpenGL. It's only using 2D graphics such as glRect, texture based fonts, curves etc. Selection is based on old functions, "glSelectWithCallback" and "getScreenToGLCoord". > Shall I continue using these functions or Is there a new mechanism to select objects using OpenGL 3.x? > > Application is using display list method to cache drawing operation. I would still still prefer to use this method but I have a concerned about using current version and future versions of PyOpenGL. > You shouldn't need to recode the old application, really. While the ARB OpenGL 3.0 release declared all sorts of things deprecated, the vendors have since back-tracked and have all basically committed to supporting the legacy stuff for the foreseeable future. Particularly if you want to continue using display-lists, there's not going to be much point making the *rest* of your application legacy free. 50% of the work of going "legacy free" is moving to array-based (and by extension, VBO-based) rendering, rather than display-lists and individual calls. If you're not converting the rendering code to use arrays/vbos you likely aren't going to want to make the rest of your code legacy free (e.g. moving to shaders for rendering). Regarding selection under 3.x legacy-free, it's intended to be done with either colour-buffer selection or projection of vectors into your scenegraph (i.e. math). Colour-buffer selection can be seen in the OpenGLContext "flat" rendering pass module. PyOpenGL is unlikely to stop supporting the legacy entry points any time soon, given that they have effectively been de-deprecated by the vendors (and since almost everything written in PyOpenGL uses them)... you shouldn't use them for new code, really, but even there I'm feeling it's so much easier to get started with them that even the "legacy free" OpenGLContext shader tutorials use the legacy entry points to start out with. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |