Start of Loop in Windows Form (C#)

Started by
0 comments, last by Arild Fines 17 years, 9 months ago
I'm trying to implement a frame timer and I need to reset the stored time to the current time at the beginning of the loop. The problem is my update() and render() methods are not directly in line with getting input. More specifically, there is no while loop that says GetInput, Update, Render. I'm assuming the callback methods such as private void Window_MouseDown(object sender, MouseEventArgs e) get processed before rendering. If I do anything remotely complex in processing input (and I am) I definitely want to take that process time into account so where does the loop actually start?
Advertisement
What are you using to drive the render function? A timer? Application.DoEvents? If the latter, the loop you have around Application.DoEvents is what you're after. If the former, you should probably read this..

Actually, you should probably read it anyway. And do a search on these forums, there have been a number of discussions on that very subject.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

This topic is closed to new replies.

Advertisement