Re: PyOpenGL_accelerate / subclassed numpy arrays

Rob McMullen - NOAA Affiliate <[email protected]> Sun, 8 Nov 2015 08:20:25 -0800
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAG6S91DVfe4NPWzTc58xtBnSK3Ed3u_WFtL+Pd1HSoFAfCPNgQ@mail.gmail.com>
--===============3871147385071319485==
Content-Type: multipart/alternative; boundary=001a11440afaaf017d052409da42

--001a11440afaaf017d052409da42
Content-Type: text/plain; charset=UTF-8

I know I've run into that problem when my VBO data was in recarray format.
Defining the VBO as a view of the array in dtype=np.float32 format worked.

Rob

On Thu, Nov 5, 2015 at 11:08 PM, Nicolas P. Rougier <
[email protected]> wrote:

>
> I've made a numpy array subclass for a vertex buffer that works great with
> PyOpenGL but does not work if PyOpenGL_accelerate is installed, it
> complains about about missing handler:
>
> File "/Users/rougier/Development/Public/glumpy/glumpy/gloo/buffer.py",
> line 75, in _update
>     gl.glBufferSubData(self.target, offset, nbytes, data)
>   File "latebind.pyx", line 44, in
> OpenGL_accelerate.latebind.Curry.__call__ (src/latebind.c:1201)
>   File
> "/usr/locaL/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/OpenGL/GL/VERSION/GL_1_5.py",
> line 122, in glBufferSubData
>     data = ArrayDatatype.asArray( data )
>   File "arraydatatype.pyx", line 174, in
> OpenGL_accelerate.arraydatatype.ArrayDatatype.asArray
> (src/arraydatatype.c:4221)
>   File "arraydatatype.pyx", line 57, in
> OpenGL_accelerate.arraydatatype.HandlerRegistry.c_lookup
> (src/arraydatatype.c:2230)
> TypeError: No array-type handler for type <class
> 'glumpy.gloo.buffer.VertexBuffer'> (value: VertexBuffer([151,  10,   1,
> ...,   0, 128,  63], ) registered
>
>
> Python: 3.5
> PyOpenGL: 3.1.0
> PyOpenGL_accelerate: 3.1.0
> The package I'm developing: http://glumpy.github.io
>
> Any idea ?
>
> Nicolas
>
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> PyOpenGL Homepage
> http://pyopengl.sourceforge.net
> _______________________________________________
> PyOpenGL-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyopengl-users
>

--001a11440afaaf017d052409da42
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I know I&#39;ve run into that problem when my VBO data was=
 in recarray format. Defining the VBO as a view of the array in dtype=3Dnp.=
float32 format worked.<div><br></div><div>Rob</div></div><div class=3D"gmai=
l_extra"><br><div class=3D"gmail_quote">On Thu, Nov 5, 2015 at 11:08 PM, Ni=
colas P. Rougier <span dir=3D"ltr">&lt;<a href=3D"mailto:Nicolas.Rougier@in=
ria.fr" target=3D"_blank">[email protected]</a>&gt;</span> wrote:<br=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex"><br>
I&#39;ve made a numpy array subclass for a vertex buffer that works great w=
ith PyOpenGL but does not work if PyOpenGL_accelerate is installed, it comp=
lains about about missing handler:<br>
<br>
File &quot;/Users/rougier/Development/Public/glumpy/glumpy/gloo/buffer.py&q=
uot;, line 75, in _update<br>
=C2=A0 =C2=A0 gl.glBufferSubData(self.target, offset, nbytes, data)<br>
=C2=A0 File &quot;latebind.pyx&quot;, line 44, in OpenGL_accelerate.latebin=
d.Curry.__call__ (src/latebind.c:1201)<br>
=C2=A0 File &quot;/usr/locaL/Cellar/python3/3.5.0/Frameworks/Python.framewo=
rk/Versions/3.5/lib/python3.5/site-packages/OpenGL/GL/VERSION/GL_1_5.py&quo=
t;, line 122, in glBufferSubData<br>
=C2=A0 =C2=A0 data =3D ArrayDatatype.asArray( data )<br>
=C2=A0 File &quot;arraydatatype.pyx&quot;, line 174, in OpenGL_accelerate.a=
rraydatatype.ArrayDatatype.asArray (src/arraydatatype.c:4221)<br>
=C2=A0 File &quot;arraydatatype.pyx&quot;, line 57, in OpenGL_accelerate.ar=
raydatatype.HandlerRegistry.c_lookup (src/arraydatatype.c:2230)<br>
TypeError: No array-type handler for type &lt;class &#39;glumpy.gloo.buffer=
.VertexBuffer&#39;&gt; (value: VertexBuffer([151,=C2=A0 10,=C2=A0 =C2=A01, =
...,=C2=A0 =C2=A00, 128,=C2=A0 63], ) registered<br>
<br>
<br>
Python: 3.5<br>
PyOpenGL: 3.1.0<br>
PyOpenGL_accelerate: 3.1.0<br>
The package I&#39;m developing: <a href=3D"http://glumpy.github.io" rel=3D"=
noreferrer" target=3D"_blank">http://glumpy.github.io</a><br>
<br>
Any idea ?<br>
<br>
Nicolas<br>
<br>
<br>
<br>
---------------------------------------------------------------------------=
---<br>
_______________________________________________<br>
PyOpenGL Homepage<br>
<a href=3D"http://pyopengl.sourceforge.net" rel=3D"noreferrer" target=3D"_b=
lank">http://pyopengl.sourceforge.net</a><br>
_______________________________________________<br>
PyOpenGL-Users mailing list<br>
<a href=3D"mailto:[email protected]">PyOpenGL-Users@list=
s.sourceforge.net</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/pyopengl-users" rel=
=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listi=
nfo/pyopengl-users</a><br>
</blockquote></div><br></div>

--001a11440afaaf017d052409da42--


--===============3871147385071319485==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------

--===============3871147385071319485==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users

--===============3871147385071319485==--