DirectFB weirdnes

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.
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. I’ve also specified that I want the buffers in
hardware and want to use hardware double buffering.

I will try to turn off the hardware doublebuffering to see if the problem
still appears. is this a known issue? - or is it a fault of my own?

Sincerely,
/Magnus—
“A well-written program is its own Heaven; a poorly-written program is its
own Hell.”

  • The Tao of Programming

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:

If you don’t figure anything out, contact the author of DirectFB,
who wrote the SDL driver for it. :slight_smile:

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment> On Tuesday 13 November 2001 08:44, Magnus Sj?strand wrote:

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.)

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.)

If you don’t figure anything out, contact the author of DirectFB,
who wrote the SDL driver for it. :slight_smile:

I tried to use hardwarebuffers, but no hardware flipping - and it still
flickers. It works fine when I put the buffers in RAM and then update the
screen with dirty rectangles. The framerate dropped by 20 fps though, but it
works for now.

/MagnusFrom: slouken@libsdl.org (slouken)
To:
Sent: Thursday, November 15, 2001 5:12
Subject: Re: [SDL] DirectFB weirdnes

On Tuesday 13 November 2001 08:44, Magnus Sj?strand wrote: