Re: experimental "buffer" protocol array support in 3.1

Antoine Martin <[email protected]> Mon, 07 Apr 2014 18:28:56 +0700
Newsgroups gmane.comp.python.opengl.user
Message-ID <[email protected]>
On 25/02/14 04:13, Mike C. Fletcher wrote:
> On 14-02-24 10:36 AM, Antoine Martin wrote:
>> Hi,
>>
>> Can you expand on this new buffer protocol? Is worth using yet?
> At the moment it's only registered for __builtin__.memoryview and 
> __builtin__.bytearray objects. Internally it uses memoryview on the 
> buffer-api supporting objects, and the <buffer> object doesn't *seem* to 
> be compatible (?? weird).
Yes, that's really annoying. See "Ugliness of 2.7":
http://demianbrecht.github.io/posts/2013/02/10/buffer-and-memoryview/#ugliness
>  If you can get your buffer object into a 
> buffer-api supporting object (something you can call memoryview() on) 
> you should be able to pass it into the APIs.
>
> As for testing for support,
>
>      if OpenGL.version.__version__.split('.')[:2] >= ['3','1']:
>
> then you should have the buffer api handler.
Thanks!
I have finally tested it properly and it all works fine.

Cheers
Antoine

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net