Use DirectFB to build a picture viewer in an Angstrom console application


I would like to use DirectFB with Ångström console-image to display
some graphics.

I installed the DirectFB libraries and can compile this code (Tutorial
on ):

#include <stdio.h>
#include <unistd.h>
#include <directfb.h>

ic IDirectFB *dfb;
static IDirectFBSurface *primary;
static int w = 0;
static int h = 0;

int main (int argc, char **argv)
DFBSurfaceDescription dsc;

DirectFBInit (&argc, &argv);
DirectFBCreate (&dfb);
fb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN);
dsc.flags = DSDESC_CAPS;
dfb->CreateSurface( dfb, &dsc, &primary );
primary->GetSize (primary, &w, &h);
primary->FillRectangle (primary, 0, 0, w, h); // without this function
i have no errors or warnings
primary->SetColor (primary, 0x80, 0x80, 0xff, 0xff);
primary->DrawLine (primary, 0, h / 2, w - 1, h/ 2);
primary->Flip (primary, NULL, 0);
sleep (5);
primary->Release( primary );
dfb->Release( dfb );
return 23;

I have no compiler errors or warnings but if I try to run it, it
crashes and throws me back to console. If I run it with the x11-image
I have a x-server crash and have to lock in again.

DirectFB gives some very interesting massages in the console like:
- (!) DirectFB/FBDev: yres 720, vres720, offset 720
- (!?!) *** BUG [panning buffer out of range] *** [fbdev.c:1560 in
- (!) [ 2006: 0.000] - -> Caught signal 11 (at 0x49e4900, invalid
permission) <--
- (!!!) *** WARNING [still objects in ‘Layer Region Pool’ ] ***
[ object.c:241 in fusion_object_pool_destroy()]

May be somebody have or had the same problems and can help me to fix
the problem or show me other methods to view pictures (png) in the

If I compile it without
           primary->FillRectangle (primary, 0, 0, w, h);
everything works and I get a reserved “window” for 5 seconds.

Thanks and regards,