[SDL] CPU usage
Charles McGarvey
onefriedrice at brokenzipper.com
Fri Feb 8 17:10:56 PST 2008
I agree. Sure it will take more time to implement correctly, but sharing
system resources including (especially?) cpu time is the right thing to do,
even for full-screen apps. Consider if somebody wants to play your game on
a laptop via battery power. Obviously they wouldn't be able to play very
long if your game just sits in a loop without yielding. Maybe people don't
usually play games on battery, but maybe the reason is because most games
are not implemented correctly and do burn down the battery needlessly. Just
make your app do the right thing. Maybe most users won't notice how nicely
your app shares the system, but I think you're bound to make a few people
happier.
Chaz
----- Original Message -----
From: "Lilith Calbridge" <lilith at dcccd.edu>
> Can't say I agree with that. Many are the times when I've left lengthy
> usenet downloads going in the background while I brought up a game. Sure
> 'nuff the downloads dropped to a very noticeable crawl.
>
> Lil
>
>>>> On 2/8/2008 at 5:50 PM, "Alex Barry" <alex.barry at gmail.com> wrote:
>> Hey,
>>>From my experience as a game programmer, if you are designing a game
>>>that's
>> fullscreen, you shouldn't ever worry about the CPU usage, considering
>> there
>> won't be any other programs in use while it's running. If you really
>> feel
>> you need a delay, use SDL_Delay( 1 ) which will give up the smallest
>> timeslice available, while still giving your program the most attention.
>> Again, I can never stress enough that if you are making a fullscreen
>> game,
>> you should never *need* a delay
>>
More information about the SDL
mailing list