Quoting Nathanael Noblet:
> Hello,
>       So I'm embarking into an area I have little experience in. I've done 
> minimal gui programming but find myself needing/wanting to use DirectFB 
> for a couple projects. I've worked through some of the examples and 
> tutorials. As well as modifying my own "learning" code. What I still 
> kinda fail to understand is the concept/difference of windows vs layers 
> vs surfaces. I think I have a good understanding of them but I'm still 
> not sure. Each example kinda goes at the whole thing differently. I 
> understand that each layer & window has a surface, and it is to the 
> surface that I would do all the drawing/blitting. What I don't 
> understand is the difference between a layer and a window.

Layers are provided by the hardware as individual frame buffers that are
composited in real time to produce the "picture" on your screen.

Traditional hardware has one fullscreen layer for RGB graphics and
probably a video overlay for YUV scaling in hardware.

Modern hardware provides one or two hands full of layers with different
capabilites for lots of purposes, basically Graphics, Video, Background.

Windows are provided by the software as individual frame buffers that are
composited when an application flips an area of its window surface. Both
window management modules use the accelerated blitting functions to compose
the damaged area without blitting a single pixel needlessly. Starting from
the top of the stack, a recursive function dives into it and sub divides the
area if it reaches an intersection with an opaque window, i.e. calling itself
up to four times for the remaining parts outside of the intersection. If the
bottom is reached, the recursion collapses and all tiles are blitted in the
correct order while each stack frame is left :-)

If you use IDirectFBDisplayLayer in exclusive cooperative level you can
reconfigure the display layer and directly use its surface without creating
a window.

> Windows:
>       Receive events
>       Can be stacked

right

>       Can be made of multiple layers (ie video overlay on a window?)

wrong, layers are made of multiple windows or used directly

> Layers:
>       Don't receive events    
>       Stacked..?

right

Another key difference is that layers exist and you Get() them,
while you can Create() any number of windows.

> I find myself trying to create a program that will have exclusive 
> control of the FB. Kiosk type system. So I imagine I won't need windows 
> since the whole thing is being used and exclusively. Though each part 
> of the program needs to be able to accept events (which I have learned 
> going through the examples). I find though using windows, I can update 
> only part of the whole "screen" which I assume is a good thing since 
> blitting a portion versus the whole thing would seem to be faster..?

You can also update portions of the screen in exclusive mode.

The advantage of using windows is that you can develop the different
parts of your software more individually. You don't have to manage
coexistence fully on your own.

> Since I would be going with a windowless system I assume I would need 
> to handle the location of mouse clicks & translate that to the button 
> location as well as any input. Since there is no *focus* per say as 
> there would be on a window version?

Yes, but also in windowed mode DirectFB provides focus switches
between windows only, not between any elements, that's up to the toolkit.

> So after all that blabbering. Is there more documentation besides the 
> API docs on www.directfb.org that could explain the subtle differences 
> between a window/layer? Perhaps not even directfb related but documents 
> or books on gui fundamentals that would help an experienced programmer 
> learn gui programming?

http://www.directfb.org/docs/DirectFB_overview_V0.2.pdf

-- 
Best regards,
  Denis Oliver Kropp
 
.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"

                            Convergence GmbH


Reply via email to