[SDL] Scrolling background
David Olofson
david.olofson at reologica.se
Tue Jun 12 00:47:22 PDT 2001
On Tuesday 12 June 2001 08:56, Jan Kratochvil wrote:
> Hi,
> i tried to make scrolling background using SDL and i have to make some
> terible mistake because it is teribly slow.
> I am using resolution 800x600 (32b colors).
> is there any better(faster) solution than using
>
> SDL_BlitSurface(image, &src, screen, &dest);
> SDL_UpdateRect(screen,0,0,0,0);
>
> where src y coordinate is incrementing. If i call this two functions in
> for cycle i get speed from 6 up to 10 frames per second.
> Please help.
Well... The usual stuff; make sure...
* ...that the image is in the exact same format as the screen surface.
* ...that the screen surface format is directly supported by the hardware.
* ...that the image is in VRAM, and thus can be blitted by the GPU, or...
* ...that the driver can do fast DMA transfers from system RAM.
Unfortunately, the last two are problematic on some platforms. (For example,
Linux has no targets so far, that support busmaster DMA transfers from sysRAM
to VRAM, which is a major issue if you need to do software rendering.)
//David Olofson --- Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
`----------------------> http://www.linuxaudiodev.com/maia -'
.- David Olofson -------------------------------------------.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`--------------------------------------> david at linuxdj.com -'
More information about the SDL
mailing list