I have an application in a GUI made in wx.Python. I’m rendering graphics with gl* calls, on wx.glcanvas instances.
I init() them like so:
glcanvas.GLCanvas.init(self, parent, -1)
get their contexts:
self.context = glcanvas.GLContext(self)
set their contexts in OnPaint():
So, when I only have one glcanvas, everything works fine. But I want to have multiple canvases, rendering different things in the GUI. Their contexts and buffers seem to be interfering with each other, though. I get a lot of issues, most of the time I’ve been able to ‘band aid’ over them. But I’m trying to access pixels in the back buffer in one of my canvases, and now I can’t do this, since adding the other canvas to the program. Just wondering if anyone has any experience with these issues? Has anyone rendered on multiple windows or canvases in Py.OpenGL? I believe the buffers are messed up, which is causing the exception thrown from GL\images.py.
My exception details:
ArgumentError: argument 7: <type ‘exceptions.TypeError’>: wrong type
pixelRed = glReadPixels(x, viewport - y, 1, 1, GL_RED, GL_BYTE)
File “C:\Python27\lib\site-packages\OpenGL\GL\images.py”, line 362, in glReadPixels
this function that throws this is in images.py,