DirectFB - Home of the pragmatist Roadmap

[directfb-dev] Re: how to CreateSurface on CRTC2 layer for G400
Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[directfb-dev] Re: how to CreateSurface on CRTC2 layer for G400

On Sun, Dec 15, 2002 at 09:37:30AM -0500, wrote:
> I am trying to coerce SDL compiled with DirectFB to display on the
> G400's CRTC2.  The app. that I am trying to display on SDL DirectFB is
> freevo.
> All of the code examples of using CRTC2 that I have seen show creating
> a DirectFB context, then getting layer 2 of this context, and then
> getting the surface from the layer:
>   DirectFBCreate(&dfb);
>   dfb->GetDisplayLayer(dfb, 2, &crtc2);
>   crtc2->GetSurface(crtc2, &c2frame);
> This makes sense to me.  SDL however, _creates_ a surface (with
> CreateSurface()) directly on the DirectFB context:
>   DirectFBCreate(&dfb);
>   dfb->GetDisplayLayer(dfb, 2, &layer);
>   dfb->CreateSurface(dfb, &dsc, &surface);
> and then operates on this surface.
> I have tried to replace the CreateSurface() with a GetSurface() but I
> wind up getting a segfault in the application.  Should a
> GetSurface(layer, ...) be substitutable for a
> CreateSurface(DFBContext, ...) or is it more complicated than that?

Yes if CreateSurface() had DSCAPS_PRIMARY. Otherwise the surface is not
related to any specific layer in which case you should keep using
CreateSurface(). Perhaps the code assumes something about the surface
size. CRTC2 surface has a fixed size so you'll have to make sure the code
understands that. 

> I have already had to hack SDL to use layer 2 rather than DLID_PRIMARY
> like I did with GTK+DirectFB, but this CreateSurface() has me puzzled.
> If CRTC2 is implemented as an additional layer on the DirectFB
> context, then how can CreateSurface() know which layer to create the
> surface on?

It doesn't. If you use CreateSurface() with DSCAPS_PRIMARY you are doing
the same thing as primary_layer->GetSurface(). With other layers you must
use GetSurface().

Ville Syrjälä

Info:  To unsubscribe send a mail to with 
"unsubscribe directfb-dev" as subject.

Home | Main Index | Thread Index / Development / Old Archives