Hi!

I was pretty confused about the DFB notions of windows, surfaces and layers. 
Reading the PDFs from the documentation/architecture section of the DFB site 
cleared things up for me a little...

Basically, the way I understand it now (experts please correct me if anything I 
write is wrong!!):

Surfaces are simply pixel buffers, areas in System or Video RAM for storing 
pixels in defined formats. Depending on the capabilities of your hardware, 
drawing operations and pixel-copies ('blits') may be accellerated or not. 
DirectFB hides this from you by providing software implementations for 
unaccellerated operations.

Layers are associated with the graphics hardware, and represent a 'screen' in 
some abstract sense. A given graphics card should have at least one layer, but 
may offer more - either because it supports more screens, or because it 
supports 'overlay' layers or something like that. The details really depend on 
the hardware.
The important thing is that a layer is associated with a primary surface - an 
area you can draw into to make things appear on the screen. For hardware that 
supports more than one layer on the same screen what is actually seen depends 
on how the layers are combined to form the image.

As I understand it, each surface in directfb is completely 'mapped' (allocated) 
in memory (either system or video). That includes the primary surface of a 
layer. So anything you draw to that surface will 'stick' until you draw over it 
again, within that surface. Drawing to the surface of another layer might 
affect the image you see if the two layers 'belong' to the same screen, but 
that is handled by the hardware or directfb. The surfaces of the layers are 
independant pixel buffers. So as I understand it you would only need to draw 
your background into the background layer once.

Whether or not you need to Flip the primary surface of a layer depends only on 
whether that surface is double buffered, and is independant of the rest of this 
discussion...

Richard Unger







-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Nathanael D. 
Noblet
Gesendet: Mittwoch, 05. Oktober 2005 19:45
An: [email protected]
Betreff: [directfb-users] Layers question...


Hello,
    So I'm working on a simple kiosk style app. There is a background and in 
the foreground are images and text. Pretty simple. The text needs to scroll, 
which it does. Everything is working, however I'm wondering about layers. I 
don't fully understand them, but I'm wondering if the following explanation is 
correct.


If I were to setup the application and it had two layers, could I get an 
interface to the lower & higher layers and draw to them independently and 
DirectFB would deal with flipping if/when either changed (not saying I don't 
call flip), but for example, if the background never changes, and I draw clear 
the top layer and redraw it, then call flip, it'll show properly without me 
having to redraw the bottom layer as well? Is that how they work?

-- 
Nathanael D. Noblet
Gnat Solutions, Inc
http://www.gnat.ca/
T 250.385.4613
C 250.383.4613


_______________________________________________
directfb-users mailing list
[email protected] 
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to