i am trying to get an animated opengl drawing under Tk but i dont get it
right. I am using the after() function to call the Opengl instance's
This is more or less what i do:
from OpenGL.Tk import *
self.glcanvas = Opengl(width=800, height=600, double=1)
self.glcanvas.redraw = self.draw
self.glcanvas.pack(side='top', expand=1, fill='both')
def draw(self, event=None):
self.render() # opengl stuff goes here
self.glcanvas.tkExpose() # redraw
# clean background, draw, swap buffers etc...
So far I am getting a stack overflow :
File "/usr/lib/python2.4/site-packages/OpenGL/Tk/__init__.py", line
492 in tkRedraw
GLerror: [Errno 1283] stack overflow
Probably i am confused with what to put inside the redraw() function and
the how to use the after().
I have been trying to find examples of animations with Tk but could not
find any. Also could not find much information online specifically about
using tk with opengl so i am using help(OpenGL.Tk) as main source of
info. It would be nice to have some other resource if anyone suggest one.