J
Jon Jacobs
In VB I am doing an animation via Application.Idle.
My idle routine is:
Private Sub Form1_Idle(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Draw()
Application.RaiseIdle(e)
End Sub
I use RaiseIdle so I don't just draw one frame and wait until I wiggle the
mouse or something so it can go back to idle.
The animation is very smooth, and I get about a 1000 frames per second (fps)
This works for a while, but my application is very unresponsive and quits
after about a minute. If I run in the IDE, it quits in only 5 seconds or so.
If I add Application.DoEvents right after Draw, the app is very responsive,
but I get a stack overflow.
How do I avoid these problems?
Thanks,
Jon
My idle routine is:
Private Sub Form1_Idle(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Draw()
Application.RaiseIdle(e)
End Sub
I use RaiseIdle so I don't just draw one frame and wait until I wiggle the
mouse or something so it can go back to idle.
The animation is very smooth, and I get about a 1000 frames per second (fps)
This works for a while, but my application is very unresponsive and quits
after about a minute. If I run in the IDE, it quits in only 5 seconds or so.
If I add Application.DoEvents right after Draw, the app is very responsive,
but I get a stack overflow.
How do I avoid these problems?
Thanks,
Jon