[PyOpenGL-Devel] [ pyopengl-Patches-643038 ] Tk Rawopengl resize / matrix mode fix
Brought to you by:
mcfletch
|
From: <no...@so...> - 2002-11-24 13:10:53
|
Patches item #643038, was opened at 2002-11-24 13:10 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305988&aid=643038&group_id=5988 Category: Tk Group: v2.0 Status: Open Resolution: None Priority: 5 Submitted By: Tom Whittock (tomwhittock) Assigned to: Nobody/Anonymous (nobody) Summary: Tk Rawopengl resize / matrix mode fix Initial Comment: Apologies for this not being in a proper patch format. I can't find the file in your CVS respository, so I don't know if this is even relevant anymore. If you attempt to resize a Rawopengl Widget, you can get into a situation where it recieves a tkRedraw-using message during the update_idletasks call inside tkRedraw. This is only a problem inside the gl{Push|Pop}Matrix pair, since you can cause a stack overflow. Also, I wouldn't rely on self.redraw to keep the matrix mode as projection, so I put another matrix mode set in there. Here's the "fixed" function. Perhaps it'd be a good idea to know why update_idletasks is being called in redraw. distribution file: OpenGL/tk/__init__.py class Rawopengl: def tkRedraw(self, *dummy): # This must be outside of a pushmatrix, since a resize event # will call redraw recursively. self.update_idletasks() self.tk.call(self._w, 'makecurrent') _mode = glGetDoublev(GL_MATRIX_MODE) glMatrixMode(GL_PROJECTION) glPushMatrix() self.redraw() glFlush() glMatrixMode(GL_PROJECTION) glPopMatrix() glMatrixMode(_mode) self.tk.call(self._w, 'swapbuffers') ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305988&aid=643038&group_id=5988 |