Smooth bitmap scrolling?

Hi,

I’m not sure if this question is directly SDL related, however I thought
I would check first.

The problem I have is I’m trying to move 1 bitmap (150x150) from the top
of the screen to the bottom by a number of pixels every loop. This
sounds ridiculously simple, however the problem that we have seen is
that it is never smooth when you increase the velocity of the image
moving. If for example the image is moved down 5 pixels per loop there
is a horrible shaking and shivering effect experienced. I’ve tried fixed
velocities as well as the fps detection method and still the same
problem exists.

We were running this demo at 1024x768 (16bpp) on our hardware and
decided to test it on higher spec machines to make sure this wasn’t a
limitation of it and even with a GeForce4 Ti on a P4 2.6 there is the
same effect. All the correct drivers are install and games such as Q3
run at 196 fps in this mode so that should eliminate a hardware
bottleneck. Also when checking SDL_VideoInfo all operations are
supported which confuses me further why it can’t perform this simple
task.

I could be doing something wrong (oh very likely :o) but it’s been
driving me mad for a while now and can’t understand why.

Does anyone have any suggestions, links to url’s or previous related
answers that may help with this problem? I haven’t included any source
code as no matter how we try this we experience the same problem. At
high speeds the effect isn’t visible but we need the image to move
slowly down the screen.

My initial thoughts are to move to SDL+Ogl but didn’t want to have to
unless there is a good reason.

Would be grateful for any tips or advice as it’s driving me mad!! :o)

Cheers,

Lee

Just a short note:

Your are probably doing something wrong.
I guess your moving/fps-syncing code is broken.

Smooth animation is possible with SDL (without OGL).
For example we have a SDL-sidescroller with more than a dozen of objects
animating smoothly, its running at 800x600x16bit with roughly about >30fps
(depends on the used PC of course).

I remember some relevant articles (even on non-SDL-lists), but cannot
reference them by heart.

I would suggest to search the archives/web using keywords like
"fps,independent,movement,sprite,smooth,animation,timing,…"
or similar,

or provide relevant parts of your source

greetings,
Thomas> ----- Original Message -----

From: lee@iostorm.net (Lee Weekes)
To:
Sent: Wednesday, June 25, 2003 2:41 PM
Subject: [SDL] Smooth bitmap scrolling?

Hi,

I’m not sure if this question is directly SDL related, however I thought
I would check first.

The problem I have is I’m trying to move 1 bitmap (150x150) from the top
of the screen to the bottom by a number of pixels every loop. This
sounds ridiculously simple, however the problem that we have seen is
that it is never smooth when you increase the velocity of the image
moving. If for example the image is moved down 5 pixels per loop there
is a horrible shaking and shivering effect experienced. I’ve tried fixed
velocities as well as the fps detection method and still the same
problem exists.

We were running this demo at 1024x768 (16bpp) on our hardware and
decided to test it on higher spec machines to make sure this wasn’t a
limitation of it and even with a GeForce4 Ti on a P4 2.6 there is the
same effect. All the correct drivers are install and games such as Q3
run at 196 fps in this mode so that should eliminate a hardware
bottleneck. Also when checking SDL_VideoInfo all operations are
supported which confuses me further why it can’t perform this simple
task.

I could be doing something wrong (oh very likely :o) but it’s been
driving me mad for a while now and can’t understand why.

Does anyone have any suggestions, links to url’s or previous related
answers that may help with this problem? I haven’t included any source
code as no matter how we try this we experience the same problem. At
high speeds the effect isn’t visible but we need the image to move
slowly down the screen.

My initial thoughts are to move to SDL+Ogl but didn’t want to have to
unless there is a good reason.

Would be grateful for any tips or advice as it’s driving me mad!! :o)

Cheers,

Lee


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

are you moving your background at a constant rate per frame or do you move
it depending on how long the last frame lasted?
the second method is the one i would recommend. at smooth framerates (30+)
you should get smooth scrolling.

Thanks,

Knowing that other people have done it at least means it’s possible, I
started to think there were some limitations.

I’ll have a search through for those keywords and see what I can find.

Thanks again much appreciated.

Lee> ----- Original Message -----

From: Thomas Eder [mailto:Thomas.Eder@nmi.at]
Sent: 25 June 2003 17:06
To: sdl at libsdl.org
Subject: Re: [SDL] Smooth bitmap scrolling?

Just a short note:

Your are probably doing something wrong.
I guess your moving/fps-syncing code is broken.

Smooth animation is possible with SDL (without OGL).
For example we have a SDL-sidescroller with more than a dozen of objects
animating smoothly, its running at 800x600x16bit with roughly about

30fps (depends on the used PC of course).

I remember some relevant articles (even on non-SDL-lists), but cannot
reference them by heart.

I would suggest to search the archives/web using keywords like
"fps,independent,movement,sprite,smooth,animation,timing,…"
or similar,

or provide relevant parts of your source

greetings,
Thomas

----- Original Message -----
From: @Lee_Weekes (Lee Weekes)
To:
Sent: Wednesday, June 25, 2003 2:41 PM
Subject: [SDL] Smooth bitmap scrolling?

Hi,

I’m not sure if this question is directly SDL related, however I
thought I would check first.

The problem I have is I’m trying to move 1 bitmap (150x150) from the
top of the screen to the bottom by a number of pixels every loop. This

sounds ridiculously simple, however the problem that we have seen is
that it is never smooth when you increase the velocity of the image
moving. If for example the image is moved down 5 pixels per loop there

is a horrible shaking and shivering effect experienced. I’ve tried
fixed velocities as well as the fps detection method and still the
same problem exists.

We were running this demo at 1024x768 (16bpp) on our hardware and
decided to test it on higher spec machines to make sure this wasn’t a
limitation of it and even with a GeForce4 Ti on a P4 2.6 there is the
same effect. All the correct drivers are install and games such as Q3
run at 196 fps in this mode so that should eliminate a hardware
bottleneck. Also when checking SDL_VideoInfo all operations are
supported which confuses me further why it can’t perform this simple
task.

I could be doing something wrong (oh very likely :o) but it’s been
driving me mad for a while now and can’t understand why.

Does anyone have any suggestions, links to url’s or previous related
answers that may help with this problem? I haven’t included any source

code as no matter how we try this we experience the same problem. At
high speeds the effect isn’t visible but we need the image to move
slowly down the screen.

My initial thoughts are to move to SDL+Ogl but didn’t want to have to
unless there is a good reason.

Would be grateful for any tips or advice as it’s driving me mad!! :o)

Cheers,

Lee


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