GameWindow modification suggestion
Iv just recently started using OpenTK to substitue XNA in my cross platform 2D Game engine. firstly, i was amazed how easy it was to use so thanks for that.
But i would like to make a suggestion for the main game loop and the paremeter passed to the Update and Render methods on the GameWindow class. Currently in update the UpdateFrameEventArgs is passed in which contains a double Time value which is the number of seconds passed since last update. I think a nice addition would be to model the XNA time class and offer ElapsedGameTime and ElapsedRealTime values on the UpdateFrameEventArgs parameter. These would both be TimeSpan's.
I would be willing to try make this mod myself and offer the solution for commit. But before i do has anyone else already done this, or does anyone have any different suggestions, would this change get commited if i was to implement it ?




Comments
Apr 23
10:56:17Re: GameWindow modification suggestion
posted by the FiddlerThis is interesting - indeed TimeSpans would be nicer (and more flexible).
What is the difference between ElapsedGameTime and ElapsedRealTime in XNA?
Apr 23
11:14:04Re: GameWindow modification suggestion
posted by conkerjoeFrom the msdn docs.
ElapsedGameTime - The amount of elapsed game time since the last update
"Fixed-step clocks update by a fixed time span upon every clock step. This results in uniform clock steps that may not actually track the wall clock time. Fixed-step clocks were popular on console systems where one had tight control over code and a fixed system performance. Fixed-step clocks are also useful when trying to achieve deterministic updates for debugging, offline rendering, or other such scenarios."
ElapsedRealTime - The amount of elapsed real time (wall clock) since the last frame.
"Variable-step clocks automatically track the difference in real-time (wall clock) that transpired since the last clock step. This type of game timing is popular on PC games where the variable PC configurations affect update time."
It also has a TotalGameTime and TotalRealTime
For my project the ElapsedGameTime is the important one but its probably worth implementing the other too for the sake of completion.
Url to the msdn doc
http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gametim...
Apr 23
11:16:41Re: GameWindow modification suggestion
posted by conkerjoeby the way if you're interested in seeing what im working on, it was originally just an XNA 2d Engine, but i ported it to OpenTK too and tested fully on Mono on a linux distribution
CreamX On Codeplex
My Blog
Apr 23
21:36:40Re: GameWindow modification suggestion
posted by the FiddlerThanks for the info and the links. Your project looks very interesting!
Sounds like a good addition, I'll look into this for the next version.