
[GameWindow] Make main loop interchangeable
Posted Saturday, 22 November, 2008 - 01:49 by Kamujin| Project: | The Open Toolkit library |
| Version: | 1.0-beta-1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
The following attachments support the proposed interleaved scheduler as described in the forums.
The scheduler uses an interleaved pattern of sleep times to approximate sleep durations of greater precision then is support by the operating system.
The scheduler uses an adaptive logic to continuously tune the sleep interval pattern to match the target render frame rate and update frame rate.
Fiddler, do you want me to improve upon this to include things like Update/Render interval smoothing? bounding?
I've been trying to keep it simple so as not to over reach.
Although I do use this already internally, there are enhancements that I add to make it more consistent. As it stands, this scheduler assumes the consumer will do some pre-processing with the elapsed times to clean them up.
| Attachment | Size |
|---|---|
| GameWindow.patch | 3.81 KB |
| InterleavedScheduler.cs | 8.1 KB |


Comments
#11
It should be possible to create a custom game loop by overriding GameWindow.Run().
#12
The game loop is now completely optional. You can inherit from NativeWindow to provide a completely custom game loop, or inherit from GameWindow and override the Run() method.
#13
Closing issues fixed in 1.0 beta-1.