Re: [PyOpenGL-Users] [SOLVED] glDrawArrays and PyOpenGL 3.0.0a6 anything changed?
Brought to you by:
mcfletch
From: V. A. S. <so...@es...> - 2007-10-09 06:43:30
|
Hello, Thank you for your continued PyOpenGL development and support. It is really great. At 22:36 08/10/2007 -0400, Mike C. Fletcher wrote: >I'm using glReadPixelsub in the readpixelleak test in OpenGLContext and >the result is coming back as a uint8 array there. Sorry to be a pain, but >have you got a bit of code where I could see the failure Just adding the code below to the previously submitted file illustrates the problem. I send the file as attachment but it is just to avoid problems because it is the same file as before. (Just click on the displayed widget) def mousePressEvent(self, event): self.lastPos = qt.QPoint(event.pos()) #get the color x = self.lastPos.x() y = self.lastPos.y() y = self.height()- y self.makeCurrent() color = GL.glReadPixelsub(x, y, 1, 1, GL.GL_RGBA) #workaround a PyOpenGL bug if color.dtype == 'int8': print "WARNING: int8 received" color = color.astype(numpy.uint8) else: print "received %s" % color.dtype print "Color = ", color (Well, actually is not needed to use that PyQt specific approach, just adding the lines below to the end of the paintGL method is enough): color = GL.glReadPixelsub(0, 0, 1, 1, GL.GL_RGBA) if color.dtype == 'int8': print "WARNING: int8 received" >(it's pretty easy to fire up pdb and trace through the wrappers to see >where something goes wrong with the 3.x version) After all your effort to convert PyOpenGL to ctypes I guess I will have to learn to use pdb ... :) Best regards, Armando |