Fast Scrolling

After read ‘A faster way’ thread, and
after did some test with SDL and SDL_Update on
all over my window (640x480) I’m very dissapointed :frowning:
I’m trying to make a fast scroll routine, but the
only way I found is to Update all every darn frame :frowning:
This way is very slow, at least on my k6 233 + S3 (Linux)
I’m wondering if anyone knows a way to make a fast (vertical)
scroller.

ciao,
Marco

p.s. SDL_Flip is slow like hell on my system :frowning:

After read ‘A faster way’ thread, and
after did some test with SDL and SDL_Update on
all over my window (640x480) I’m very dissapointed :frowning:
I’m trying to make a fast scroll routine, but the
only way I found is to Update all every darn frame :frowning:
This way is very slow, at least on my k6 233 + S3 (Linux)
I’m wondering if anyone knows a way to make a fast (vertical)
scroller.

ciao,
Marco

p.s. SDL_Flip is slow like hell on my system :frowning:

The real way to implement a scroller is to adjust the display aperture
(portion of video memory which is being displayed) dynamically. It’s
a more fine-grained application of the process which allows double
buffering.

Unfortunately, with modern video cards, the only API that I know of
that supports this is X11 DGA. When in a window, you have to implement
scrolling with a full-window copy. DirectX only supports page flipping.

If someone knows better, please let me know!

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

> The real way to implement a scroller is to adjust the display aperture > (portion of video memory which is being displayed) dynamically. It's > a more fine-grained application of the process which allows double > buffering. > > Unfortunately, with modern video cards, the only API that I know of > that supports this is X11 DGA. When in a window, you have to implement > scrolling with a full-window copy. DirectX only supports page flipping. > > If someone knows better, please let me know! But this wont work with a parallax scroller would it?

Prasanth Kumar wrote:

> The real way to implement a scroller is to adjust the display aperture > (portion of video memory which is being displayed) dynamically. It's > a more fine-grained application of the process which allows double > buffering. > > Unfortunately, with modern video cards, the only API that I know of > that supports this is X11 DGA. When in a window, you have to implement > scrolling with a full-window copy. DirectX only supports page flipping. > > If someone knows better, please let me know! But this wont work with a parallax scroller would it?

after getting a lot of info from the ‘faster way’ thread I started I
found that
I can easily get 100 fps on my P2-450 (640x480x8bpp in a window) by NOT
redrawing the
entire buffer every time.
I’ll try and explain how I would work it for a paralax scroller…
you build up several layers, each one is wider than the physical
display, say 4 times the width, then you blit from those to your real
back buffer. This way you only have to re-draw the individual layers
from the game when your window goes out of scope… I didn’t explain
well.
ok, lets try it this way

window on desktop±------------------+
| |
| |
| |
±------------------+
background layer buffer
±--------±------------------±--------------------------------------+
| | | |
| | background | |
| | view | |
±--------±------------------±--------------------------------------+
Forground layer buffer
±------------------------±------------------±----------------------+
| | | |
| | forground view | |
| | | |
±------------------------±------------------±----------------------+
back buffer
±------------------+
| |
| |
| |
±------------------+

copy the background view portion of the background buffer to the back
buffer
then overlay that with the forground view portion of the forgroundlayer
buffer
then blit the back buffer to the display surface.

You only redraw the background or forground layers when the view onto
those layers goes outside what you already have pre-drawn. This should
get you over 50fps on a 166 mhz machine. The newest version of my iso
code
uses something similar to this and gets nearly 20fps on a P150 (640x480)
this is
up from 4.8 fps if I re-draw the entire display each time.

			-fjr

I’m currently coding a scrolling engine. You can take a look at it here:
http://members.linuxstart.com/~karlb/sgames.html

Marco Salvi wrote:>

After read ‘A faster way’ thread, and
after did some test with SDL and SDL_Update on
all over my window (640x480) I’m very dissapointed :frowning:
I’m trying to make a fast scroll routine, but the
only way I found is to Update all every darn frame :frowning:
This way is very slow, at least on my k6 233 + S3 (Linux)
I’m wondering if anyone knows a way to make a fast (vertical)
scroller.

ciao,
Marco

p.s. SDL_Flip is slow like hell on my system :frowning:

I’m currently coding a scrolling engine. You can take a look at it here:
http://members.linuxstart.com/~karlb/sgames.html

Marco Salvi wrote:>

After read ‘A faster way’ thread, and
after did some test with SDL and SDL_Update on
all over my window (640x480) I’m very dissapointed :frowning:
I’m trying to make a fast scroll routine, but the
only way I found is to Update all every darn frame :frowning:
This way is very slow, at least on my k6 233 + S3 (Linux)
I’m wondering if anyone knows a way to make a fast (vertical)
scroller.

ciao,
Marco

p.s. SDL_Flip is slow like hell on my system :frowning:

Hello Sam

The real way to implement a scroller is to adjust the display aperture
(portion of video memory which is being displayed) dynamically.

That’s the way I do vertical scrollers on my old amiga :slight_smile:
(I have to change some pointers and it’s done)

It’s
a more fine-grained application of the process which allows double
buffering.

yeah.

Unfortunately, with modern video cards, the only API that I know of
that supports this is X11 DGA. When in a window, you have to implement
scrolling with a full-window copy.

Damn :frowning:
I tried to figure out how to adjust screen pointers in SDL…and in fact
I failed :slight_smile:

DirectX only supports page flipping.

I saw several games performs fast (even parallax) scrolling in windows
using dx5.
So…do they update entire screen all the times?

If someone knows better, please let me know!

mee to :slight_smile:

ciao,
MarcoOn 15-Ago-99, you wrote:

Hello KarlOn 15-Ago-99, you wrote:

I’m currently coding a scrolling engine. You can take a look at it here:
http://members.linuxstart.com/~karlb/sgames.html

I tried it some days ago…and it’s too slow for my project.
Anyway…is not your fault…that is the kind of frame rate
one can expect using ‘classic’ tecnique.

ciao,
Marco