Rob Shortt schrieb:
> Denis Oliver Kropp wrote:
>> Rob Shortt schrieb:
>>> Hi,
>>>
>>> When using the cooperative mode DFSCL_NORMAL the docs say that the 
>>> "primary surface will be the buffer of an implicitly created window". 
>>> After calling CreateSurface() is there a good way to get the 
>>> IDirectFBWindow of this implicitly created window?  The only other way 
>>> may be to guess this window's ID and get it that way.
>>>
>>> I would also like to be able to set the position of this implicitly 
>>> created window.
>> Why not create a window? Or do you need the fullscreen mode as well?
> 
> I need fullscreen mode as well, but am handling that anyways.  I am 
> handing the primary surface off to evas and I think it's behaviour, or 
> lack thereof, is causing me problems.
> 
> Is there a difference with how DirectFB flips its surfaces if it's the 
> primary or not?  The reason I ask is because if I set DSCAPS_PRIMARY 
> (using DFSCL_NORMAL or DFSCL_FULLSCREEN) the surface is updated 
> normally.  If I do not set DSCAPS_PRIMARY, then my surface is not 
> updated.  I did some playing around and I could flip the surface from 
> another application and it showed up.
> 
> I have been digging through the evas code, and have been working on it a 
> bit as well, and I see that it does not call flip() at all.  I am now 
> assuming that this would be unneeded for the primary surface because of 
> the way DirectFB is managing it.  It that correct?  Please enlighten me. :)

Window surfaces always require a Flip(). Layer surfaces require a Flip()
unless the buffer mode is DLBM_FRONTONLY.

> I have also tried creating a window for the primary surface with 
> DSCAPS_PRIMARY like:
> 
>          DFBWindowDescription wdesc;
>          wdesc.flags = DWDESC_SURFACE_CAPS | DWDESC_CAPS | DWDESC_WIDTH 
> | DWDESC_HEIGHT | DWDESC_PIXELFORMAT | DWDESC_POSX | DWDESC_POSY;
>          wdesc.caps = DWCAPS_ALPHACHANNEL | DWCAPS_NODECORATION;
>          wdesc.width = width;
>          wdesc.height = height;
>          wdesc.pixelformat = DSPF_ARGB;
>          wdesc.posx = win_x;
>          wdesc.posy = win_y;
>          wdesc.surface_caps = DSCAPS_PRIMARY;
>          DFBCHECK(layer->CreateWindow(layer, &wdesc, &window), 
> "CreateWindow");
>          DFBCHECK(window->GetSurface(window, &primary), "GetSurface");
>          DFBCHECK(window->SetOpacity(window, 0xff), "SetOpacity");

DSCAPS_PRIMARY is only allowed for IDirectFB::CreateSurface(). In both
the NORMAL and FULLSCREEN cooperative level, you DON'T need Flip()
unless you specify one of DSCAPS_FLIPPING, DOUBLE or TRIPLE.

In the case of NORMAL (a window being created implicitly), there's an
evil flipping thread continuously calling Flip() unless you specify one
of DSCAPS_FLIPPING, DOUBLE or TRIPLE.

In FULLSCREEN the buffer is directly displayed by the hardware unless
you specify one of DSCAPS_FLIPPING, DOUBLE or TRIPLE :-)

-- 
Best regards,
   Denis Oliver Kropp

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"

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

Reply via email to