Re: [PyOpenGL-Users] PyOpenGL_accelerate / subclassed numpy arrays
Brought to you by:
mcfletch
From: Nicolas P. R. <Nic...@in...> - 2015-11-09 13:22:10
|
Ok, thanks for the explanation, I'll look into that then. Nicolas > On 08 Nov 2015, at 18:04, Chris Barker <chr...@no...> wrote: > > On Sun, Nov 8, 2015 at 8:20 AM, Rob McMullen - NOAA Affiliate <rob...@no...> wrote: > 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. > > I haven't lloked an ANY of the relevant coce here, but this seems to indicae that PyOpenGL_accelerate can't handle subclasses of ndarray -- which doesn't surprise me -- it's notoriously difficult to do that. > > but the error: > > 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 > > makes me think that arraydatatype.HandlerRegistry is where you need to put awareness of a new subclass. > > or it needs to be fixed to recognize ndarray subclasses -- either by directly checking if it is a proper subclass, or by using the array protocol -- which I think is the __array__ method... > > HTH, > > -CHris > > > > Rob > > On Thu, Nov 5, 2015 at 11:08 PM, Nicolas P. Rougier <Nic...@in...> 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 > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > ------------------------------------------------------------------------------ > > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > > -- > > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chr...@no... |