SDL_Delay problem on laptop

Hi, All!

I’m writing my second SDL game and i have one strange problem with
SDL_Delay. I use SDL_Delay for generating delays between my frames
(every 5 msec). Everything works well on my Athlon 1200 and Duron 1000
workstations, but when i run my game on my laptop with Celeron 500, i see
that this delay began to work faster. I see that my sprites change each other
at least three times faster that i have on other computers.

What’s the problem? Can any guru help me?
Is SDL_Delay machine dependent?

My laptop config:

RedHat Linux 8.0, kernel 2.4.18-14
SDL version 1.2.4
Dell Lattitude CPx Celeron III 500Mhz, 128Mb

Thanks!–
Best regards,
Leo
Solvo Ltd.
St.Petersburg, Russia

Could this be because QueryPerformanceFrequency or the function use depends
on the clock speed of the processor and this speed is variable on your
labtop?> ----- Original Message -----

From: leo@solvo.ru (Leonid V. Khramov)
To: “SDL mailing list”
Sent: Thursday, April 03, 2003 4:38 PM
Subject: [SDL] SDL_Delay problem on laptop.

Hi, All!

I’m writing my second SDL game and i have one strange problem with
SDL_Delay. I use SDL_Delay for generating delays between my frames
(every 5 msec). Everything works well on my Athlon 1200 and Duron 1000
workstations, but when i run my game on my laptop with Celeron 500, i see
that this delay began to work faster. I see that my sprites change each
other
at least three times faster that i have on other computers.

What’s the problem? Can any guru help me?
Is SDL_Delay machine dependent?

My laptop config:

RedHat Linux 8.0, kernel 2.4.18-14
SDL version 1.2.4
Dell Lattitude CPx Celeron III 500Mhz, 128Mb

Thanks!

Best regards,
Leo
Solvo Ltd.
St.Petersburg, Russia


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

“Olaf van der Spek” writes:

Could this be because QueryPerformanceFrequency or the function use depends
on the clock speed of the processor and this speed is variable on your
labtop?

QueryPerformaceFrequency is a windows method and Leonid is running on
Linux.

That said, SDL_Delay on Linux probably isn’t what you want for 5 ms
delays. You can’t really hope to get better resolution than 15-20 ms
with it. Rather you might have to use (I know) busywaiting (using
sched_yield perhaps) or dynamic FPS scaling (i.e draw at full speed,
scaling movement to fit a certain FPS). Unfortunately there’s no
better options available unles you have root access (then you can use
/dev/rtc for perhaps down to 100-200 ?s sleep resolution).

Why it moves faster on the PDA I don’t know. Is there a difference in
the kernel between the laptop and the other boxes? Can you do a simple
test timing of SDL_Delay to see how long it REALLY sleeps?> ----- Original Message -----

From: “Leonid V. Khramov”
To: “SDL mailing list”
Sent: Thursday, April 03, 2003 4:38 PM
Subject: [SDL] SDL_Delay problem on laptop.

Hi, All!

I’m writing my second SDL game and i have one strange problem with
SDL_Delay. I use SDL_Delay for generating delays between my frames
(every 5 msec). Everything works well on my Athlon 1200 and Duron 1000
workstations, but when i run my game on my laptop with Celeron 500, i see
that this delay began to work faster. I see that my sprites change each
other
at least three times faster that i have on other computers.

What’s the problem? Can any guru help me?
Is SDL_Delay machine dependent?

My laptop config:

RedHat Linux 8.0, kernel 2.4.18-14
SDL version 1.2.4
Dell Lattitude CPx Celeron III 500Mhz, 128Mb

Thanks!

Best regards,
Leo
Solvo Ltd.
St.Petersburg, Russia


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


[ Below is a random fortune, which is unrelated to the above message. ]
Many pages make a thick book.