Sign in to follow this  
Kalthorn

Start of Loop in Windows Form (C#)

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this