Hello all,
I'm using the function bellow to create the primary surface in an
application that has the libVLC playing videos using directfb as video out
in other thread, but when this surface is created the video playing bellow
becomes darker because the influence of transparency from this surface, I
want the drawings on this surface has a slight transparency but I don't want
that the areas with without drawings becomes dark. There's some way to do
this using the surface structure creation shown bellow (GetDisplayLayer() ->
CreateWindow() -> GetSurface()) ?
Thanks in advance
Flavio Alberto Lopes Soares
int
BackendDFB::createDFBmainSurface()
{
int result = 0;
IDirectFBDisplayLayer *layer;
DFBDisplayLayerConfig dlc;
DFBWindowDescription wdesc;
IDirectFBWindow *window;
int width, height;
wdesc.flags = DFBWindowDescriptionFlags(0);
wdesc.flags = DFBWindowDescriptionFlags( DWDESC_CAPS | DWDESC_STACKING
| DWDESC_WIDTH |
DWDESC_HEIGHT | DWDESC_POSX
| DWDESC_POSY |
DWDESC_SURFACE_CAPS );
wdesc.caps = DFBWindowCapabilities(0);
wdesc.caps = DFBWindowCapabilities(DWCAPS_NODECORATION);
wdesc.posx = 0;
wdesc.posy = 0;
wdesc.stacking = DFBWindowStackingClass(DWSC_UPPER);
if (dfb->GetDisplayLayer (dfb, DLID_PRIMARY, &layer) != DFB_OK ||
!layer)
return -1;
layer->GetConfiguration (layer, &dlc);
wdesc.width = dlc.width;
wdesc.height = dlc.height;
/*Create the main window*/
if (layer->CreateWindow(layer, &wdesc, &window) != DFB_OK || !window) {
layer->Release(layer);
return -1;
}
window->SetOpacity(window, 0x80);
window->SetStackingClass(window,DWSC_UPPER);
if (window->GetSurface(window, &wsurface) != DFB_OK || !wsurface) {
window->Release(window);
layer->Release(layer);
return -1;
}
window->Release(window);
layer->Release(layer);
if (wsurface) {
int w, h;
wsurface->GetSize (wsurface, &w, &h);
setWindowDimensions(0, 0, w, h);
}
checkHardwareCapabilities();
if (wsurface) {
int height, width;
wsurface->SetBlittingFlags( wsurface,
DFBSurfaceBlittingFlags(DSBLIT_BLEND_ALPHACHANNEL));
wsurface->SetPorterDuff( wsurface, DSPD_SRC_OVER );
wsurface->SetDstBlendFunction(wsurface, DSBF_INVSRCALPHA);
wsurface->SetDrawingFlags(wsurface, DSDRAW_BLEND);
wsurface->Clear(wsurface, 0x00, 0x00, 0x00, 0xfe);
wsurface->GetSize(wsurface, &width, &height);
printf("WIDTH = %d\n", width);
printf("HEIGHT = %d\n", height);
} else
result = -2;
return result;
}
_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users