[PyQt] Pogles, Nice!
cubicool at gmail.com
Sun Dec 2 04:54:46 GMT 2012
On 11/30/2012 06:26 PM, Phil Thompson wrote:
> On Fri, 30 Nov 2012 14:11:38 -0500, Jeremy Moles <cubicool at gmail.com>
>> Hello everyone, particularly Phil!
>> I had begun work on a C/Python extension for EGL/GLES2 written in mostly
>> pure C. It was coming along nicely, I had support for many features, and
>> then I stumbled upon pogles. It does everything I need (including RPi
>> support), and looks to be quite clean and recent.
>> I'm porting over my code from C to pogles, and had a quick question.
>> Functions like glBufferData should probably accept anything that
>> supports the buffer protocol. There is code in glVertexAttribPointer()
>> in gl_h.sip using SIP_PYBUFFER to do exactly that.
>> Should all pogles functions be extend to use this same type of
> Quite possibly.
>> If so, could SIP be adapted to, for lack of a better term
>> (and not knowing ANYTHING about SIP), "macroify" this process? :) If
>> not, what is the best way to get data into functions like glBindBuffer?
> I'm not an OpenGL programmer - the current implementation is based on what
> I've read of the Khronos docs, so I'm sure there are many ways to improve
> the API.
> What would really be helpful would be to have some decent examples -
> written (or ported) by somebody who knew what they were doing (ie. not me).
> That should raise lots of "I had to write this but what I'd really like to
> write is this", from which I can change the API so that it is a lot nicer
> for the developer.
I had a look at changing the glVertexAttribPointer() routine in
gl2_h.sip myself, but that function is a nightmare of #ifdef's (I hope
you don't mind me saying that). I really think in the spirit of clarity
and readability, the entire function should be redefined for whatever
Python version you want to support, or at least make the assumption it
will always be 2.6 and remove some of the #ifdef's.
Would you accept such a patch?
More information about the PyQt