shouzama
Freshman
Ok, maybe it's a VERY STUPID question, but still I have some trouble figuring how to achieve a fixed framerate...
Let's suppose I write my own dx engine and finally managed to render a tile-based map.
Now I'd like to place my "main character" on this map (rendered for simplicity's sake with the Sprite object).
When my char moves, it should animate. I can very simply change the "drawing frame" of my character everytime I do a BeginScene.
However, running on a fast computer this should result in a faster-than-light animation, when on a slow machine it can be painfully sloooooooooow.
What I am asking in this useless rant is some hint, link or pseudo code (I use VB.NET, but my problem is more a "conceptual" one than a "code-syntax" one) on how to handle a "fixed frame rate" animation or something similar.
Thanks anyone!
Let's suppose I write my own dx engine and finally managed to render a tile-based map.
Now I'd like to place my "main character" on this map (rendered for simplicity's sake with the Sprite object).
When my char moves, it should animate. I can very simply change the "drawing frame" of my character everytime I do a BeginScene.
However, running on a fast computer this should result in a faster-than-light animation, when on a slow machine it can be painfully sloooooooooow.
What I am asking in this useless rant is some hint, link or pseudo code (I use VB.NET, but my problem is more a "conceptual" one than a "code-syntax" one) on how to handle a "fixed frame rate" animation or something similar.
Thanks anyone!