Thread: [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 |
|
From: <no...@so...> - 2002-11-24 13:32:27
|
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') ---------------------------------------------------------------------- >Comment By: Tom Whittock (tomwhittock) Date: 2002-11-24 13:32 Message: Logged In: YES user_id=376142 I just realised that this fixes the "PyOpenGL under WinXP problem" thread on your users mailing list. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305988&aid=643038&group_id=5988 |
|
From: <no...@so...> - 2002-12-28 07:35:15
|
Patches item #643038, was opened at 2002-11-24 08: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: Closed >Resolution: Accepted Priority: 5 Submitted By: Tom Whittock (tomwhittock) >Assigned to: Mike C. Fletcher (mcfletch) 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') ---------------------------------------------------------------------- >Comment By: Mike C. Fletcher (mcfletch) Date: 2002-12-28 02:35 Message: Logged In: YES user_id=34901 This change is now in CVS (I added some try:finally: clauses to the function as well). ---------------------------------------------------------------------- Comment By: Tom Whittock (tomwhittock) Date: 2002-11-24 08:32 Message: Logged In: YES user_id=376142 I just realised that this fixes the "PyOpenGL under WinXP problem" thread on your users mailing list. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305988&aid=643038&group_id=5988 |