kl_mallory's picture

Using interval in between Frame Renders for background processes.

Would it be possible to provide an event or method to override that get's called when openTK kills time between frames? I know that when you specify a fixed frames/updates per second that there must be some delay I could take advantage of. Just wondering.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

Something like an Idle event? That's an interesting idea, never thought of that. Could you please add a feature request for this?

If you are not CPU-limited and you have enabled vsync, it is generally accepted that you can add CPU tasks right after the SwapBuffers() call with minimal performance impact. This work quite well in practice, as long as you monitor performance to make sure you are hitting your target (the Update/RenderFrequency properties in GameWindow could help here).

An Idle event would certainly be cleaner, however, so let me see if I can come up with an intuitive design. (It might be useful to have a parameter tell you how much time you have until the next scheduled Update/RenderFrame event).