Hi,
I’m writing a sprite engine, and so far everything everything works
fine, except when the sprite ( which just uses SDL_FillRect to fill its
bounds with a solid color ) enters the top 31 pixels of the screen.
When this happends the sprite starts to flicker, as if it was only
drawn in one of the hardware buffers. It works fine on all other parts
of the screen.
That sounds like you’re rendering into the wrong page - a bug in either
SDL or the fbdev driver, I’d guess. (SDL doesn’t let you chose, so I
can’t see how it could be in your code.)
I’m using SDL 1.2.3, DirectFB 0.9.7, a Riva TNT2 M64,
linux kernel 2.4.14 and a K6-2 at 450 with 192 MB RAM, the resolution is
800z600 16-bit. It worked fine when I tried it in X.
So it should… (Even if you run as root, so that you actually get h/w
surfaces.)
I’ve also
specified that I want the buffers in hardware and want to use hardware
double buffering.
Yeah, that’s the way to go - provided you really get h/w accelerated
blits, or that you’re only going to animate part of the screen. (CPU
write to VRAM will kill performance otherwise.)
I will try to turn off the hardware doublebuffering to see if the
problem still appears.
The flickering should be replaced with tearing. (SDL will request a
single buffer and blit the shadow surface into that. Even if it used
triple buffering [h/w double + soft back], there would still be tearing
if pageflipping isn’t done right.)
is this a known issue?
Not sure - I think I heard something about something like this
somewhere.
- or is it a fault of my own?
I don’t think so…
//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.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
-------------------------------------> http://olofson.net -'On Tuesday 13 November 2001 08:44, Magnus Sj?strand wrote: