开发者

Creating a forward compatible OpenGL 3.x context in Python

开发者 https://www.devze.com 2022-12-20 22:45 出处:网络
I am using wxPython and I want to use an OpenGL based canvas, but I don\'t want the c开发者_运维技巧ontext to support deprecated functionality. I\'ve navigated through pyopengl and pyglet in Eclipse,

I am using wxPython and I want to use an OpenGL based canvas, but I don't want the c开发者_运维技巧ontext to support deprecated functionality. I've navigated through pyopengl and pyglet in Eclipse, but it did not look like they support this. I'm saying this because I could not find WGL functions used in assigning attributes to a context, as in this white paper by AMD. There was also no mention in pylget's documentation of a compatibility status parameter when specifying a config for a context. Am I overlooking something? Is there a 'Python' solution or would I need to start looking at something like ctypes?

Edit: After reading some more documentation, it looks like there is a flag for the OpenGL pyopengl module, called FORWARD_COMPATIBLE_ONLY, that will filter deprecated entry points from OpenGL.GL, but only from this module. There is even mention of this on the pyopengl site under the OpenGL 3.x Deprecations section that I had not noticed before. If this implies GLSL deprecations will also be guarded against, then this looks like a solution.


I can't categorically say that there's no way of doing this but I can point out that given the largely negative response to recent revisions of OpenGL that I doubt there will be a rush for developers to incorporate this sort of thing into their libraries.

For example, pyglet's core rendering functionality mainly relies on the old pre-shader system so there is really little reason for it to provide a way to deprecate all the older functions.

I expect that if you want this at this early stage, you'll have to do it yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号