Show off your games, demos and other (playable) creations.
Ghuntar, my answer to your question is yes. At least I think that way. On each frame it does the processing and all the stuff that the default love.run does, but then it checks how much time it took and therefore how much time it has until the next frame. And then it just waits this amount of time. That way, unless the processing takes more time than is reserved for a single frame, the game should run with constant framerate, requiring only as much cpu cycles as it really needs. Don't be afraid to change the default love.run, it won't break your game. The function I supplied isn't perfect though, as e.g. it doesn't check if the love.timer module is loaded before using it. But I think I can safely assume that every game that cares about framerate does use timer. I think I'm going to start a separate topic about it, so stay tuned.
Users browsing this forum: No registered users and 9 guests