Hi Tomek.
See below for some answers..
Greets
Niels
[email protected] wrote:
1. I have one screen - so this is primary screen. If I would have
three, the primary screen always is the first, with id = 0 ?
2. I have 4 layers for this screen. Primary layer is the layer with id
= 0?
The default screen is the primary screen: DSCID_PRIMARY (this happens to
be 0)
The default layer is the primary layer: DLID_PRIMARY (this also defaults
to 0 in my build)
3. I understand that all this 4 layers are shared by all directFB
applications.
And this is why eg if application want to change layer level
IDirectFBDisplayLayer::SetLevel() it must claim ownership of this
layer with IDirectFBDisplayLayer::SetCooperativeLevel() to _EXCLUSIVE
or _ADMINISTRATIVE ?
Correct.
4.
a) Every layer has its own surface?
Normally, yes.
If you want to display video, and if your driver supports it, you can
simply pass the video through. But then you cannot use any drawing
operation on the layer. A surface can have any number of buffers, but
for a layer it is normally either 1 or 2 (for double-buffering).
b) If we want to show something on screen, it need to be draw in some
way to one of this surface?
Yes, or you can use IDirectFBWindows, which use a similar mechanism.
c) This surfaces are shared by all directFB applications, or every
application has its own set of 4 surfaces - for 4 layers?
A Layer is a global resource. Each layer has one _active_ surface at most.
If you use a newer DirectFB version things can be more complicated. If
you switch contexts, than it is possible that there are multiple
surfaces "related" to a layer, of which at most one is active. However,
an inactive layer will not use memory since the connected buffer-memory
is released on inactivation.
d) We may get this surfaces with IDirectFBDisplayLayer::GetSurface() ?
Yes.
e) If I create surface with IDirecfFB::CreateSurface(), and draw
something on it, I need to blit this surface to one of this 4 layers
surfaces?
Yes.
The screen shows the layers. And nothing more.
d) If I create window for layer IDirectFBDisplayLayer::CreateWindow()
then surface is created for that window, and everything we draw to
that surface is then "bliting" to surface of this layer.
Yes, provided you call "Flip()" when you are done drawing to the window
surface.
This is because each window has a surface with a single buffer, on top
of the layer surfaces. So you have to "manually" Flip() the contents of
the window surface to the layer surface.
e) If I create another window then another surface (independent of
first window surface) is created?
Yes.
Each window has its own surface with one buffer (except when you do
DWCAPS_COLOR).
f) Is it ok to draw directly to layer surface, or I should try to
create another one and blit it to layer surface, or try to create window.
That is however you want to do it.
It is all possible.
It is a question of convenience and performance.
Blitting to the layer directly is fastest but you have to do a lot yourself.
If you use double-buffering with back-system this way, then using a
single window and front-only on your layer is nearly as fast.
g) What is primary surface?
I guess that if we set IDirectFB::SetCooperativeLevel() to
_FULLSCREEN or _EXCLUSIVE than if we create IDirectFB::CreateSurface()
with _PRIMARY then it is "blit" with surface of primary layer of
primary screen.
But what if we set IDirectFB::SetCooperativeLevel() to _NORMAL and we
create primary surface - what this surface stands for?
Never tried that..
Any takers?
I really would like to understand this ideas.
Please for any help, answers.
Please share yours precious knowledge with me.
I be grateful.
Best regards,
Tomek.
--
.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/ |
"------------------------------------------"
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users