Re: [PyOpenGL-Users] Problems with glReadPixels
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2007-06-29 18:53:50
|
Dirk Reiners wrote: > Hi everybody, > > we're trying to use glReadPixels with PyOpenGL, but we're running into exceptions: > > Traceback (most recent call last): > File "/store/home/mukaissi/MetNetVis/MetNetVis/UI/graphdrawwidget.py", > line 155, in mousePressEvent > > index=GL.glReadPixels(event.x,event.y,1,1,GL.GL_RGB,GL.GL_UNSIGNED_BYTE) > File > "/store/home/mukaissi/software/PyOpenGL-3.0.0a6/OpenGL/GL/images.py", line > 279, in glReadPixels > ctypes.c_void_p( arrayType.dataPointer(array)) > ctypes.ArgumentError: argument 1: <type 'exceptions.TypeError'>: wrong > type > ... > This is using 3.0.0a6 on an x86_64 (RHEL) system. > > Is anybody using glReadPixels successfully? What are we missing? > I don't have any code that uses the un-decorated version. glReadPixelsub seems to work fine (at least, the OpenGLContext/tests/saveimage.py test works fine on my CVS-based version of PyOpenGL). That's on an AMD64 Gentoo machine. Code looks identical for the two versions of the function (other than a type being specified by default). If you have failing code I could pdb through it might be easier to track down the issue. One other thing, what versions of ctypes and numpy are you using? Good luck, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |