[SDL] How to accelerate
Gabriele Greco
gabriele.greco at darts.it
Tue Dec 9 07:21:01 PST 2003
wgkun at mailst.xjtu.edu.cn wrote:
> Hello!
> I have to program for a video system under linux
> which gathers video data from CCD camera and displays.I
> have completed the driver for gathering card. But because
> I'm a newbie to video programming, I have some difficults.
> The system needs display 25-50 frames per second.Each frame can be
> 1024*1024 or 512*512 with 8 bits per pixel.The video data
> are all grayscale.A friend introduced SDL to me.And I have
> made a test.Everything is ok but the display speed.
> Following are my main test codes:
Why not to draw directly to the video surface or make the video surface
a sw surface and let SDL_UpdateRects() do the blit?
I think that having a video surface that is a HW surface and blitting a
SW surface to it is always slower of both the previous solutions.
As pointed out is also a MUST that your full screen resolution is 8bit
depth as your source datas. Maybe to get this to work correcly on X you
should log as root and do export SDL_VIDEODRIVER=dga.
50fps should be quite easy to reach on 8bit depth 1024x1024 buffers on
non-prehistoric hardware, just make sure there are no conversions, 8 ->
16 and 8 -> 32 conversions are very expensive!
Bye,
Gabry
More information about the SDL
mailing list