🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

game loop timing

Started by
0 comments, last by cerberus 24 years, 9 months ago
I am trying to make my game processing and rendering loops seperate from each other...that is to say, I want my all the logic processing to happen, say, every 10 milliseconds, and all the rendering to occur as often as possible depending on the user's hardware. I've put my rendering loop in a seperate thread from all the other processing, and, while this seems to work, I don't think it is the best solution.

What other options are there? I'd like to put my rendering function at the end of the game loop and only call it if there's time left...but how much time is enough depends on the user's hardware. Any ideas?

Advertisement
Hi cerberus!

About the user's hardware: Use a routine that does some calculations and takes the time it needs. ( Maybe your game does some precalculations when started, these routines could be used for timetaking). Then you know the speed of the hardware. Depending on this value, you can chose how many LogicLoops per Rendering Loops you want to have.

hope this helps you a little

Gecko

This topic is closed to new replies.

Advertisement