[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trying Chickadee

From: Arne Babenhauserheide
Subject: Re: trying Chickadee
Date: Wed, 05 Sep 2018 22:42:43 +0200
User-agent: mu4e 1.0; emacs 25.3.1

Thompson, David <address@hidden> writes:

> Correct, the game loop doesn't stop because you're not moving
> anything. Chickadee's game loop renders frames as often as possible.
> If 100% of one CPU core is being used, the likely culprit is that
> Chickadee was unable to sync it's drawing with the monitor's refresh
> rate, which could cause it to pause a bit after rendering each frame.
> Perhaps I could automatically factor in a small usleep call when vsync
> is unavailable in order to avoid this situation.

That sounds important. In every game loop I wrote myself till now (only
two or three) I had to add some small delay because otherwise people on
laptops really notice this (though the real reason why I did it — as
opposed to the reasoning after the fact — is that it just feels wrong to
burn cycles without need).

Adding a single 1 ms sleep in the game loop should never hurt, because
even if someone has a 200Hz refresh rate (so you only have 5 ms to
render), this sleep still only take up 20% of the time between
frames. And it gives you some maneuvering mass if you find in the end
that 10% performance are missing :-)

Best wishes,
Unpolitisch sein
heißt politisch sein
ohne es zu merken

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]