I am not sure I understand what you want to do fully, so some questions:
did you create two separate windows?
do you have two different surface, i.e. are the two pointers different?
If you are using a single surface, than it is logical what happens - the
last drawing operation is the one that you see.
If you use windows, you can simply change the Z-order to define which
window is seen.
Greets
Niels
Flavio Alberto Lopes Soares wrote:
After some investigation (and some DirectFB source code reading) I
understood a bit more from my problem, I believed that DirectFB was
using Fusion between the 2 threads that
instantiates DirectFB different contexts, but I was wrong, because the
process that call the two DirectFB contexts was the same, I noticed
that the DirectFB context will be the same, because the DirectFB super
interface is a singleton and nothing to do with Fusion (because I have
only one process), the problem occurs when the thread that decodes the
video needs restart the DirectFB for some internal event and
reconfigures your surfaces without transparency and the other thread
don't know that this occured, the consequence that the video was
placed over the graphics.
There's some way to configure my graphic surface to be always
placed over the graphic surface create after by other DirectFB
initialization ?
Thanks for all help
Flavio Alberto Lopes Soares
2010/5/20 Flavio Alberto Lopes Soares <[email protected]
<mailto:[email protected]>>
Hello all,
I'm writing an application that starts a thread that uses DirectFB
to show video, and my code shows some graphic information over
this video, my application cannot access the DirectFB context of
this thread and I'm using Fusion to create other DirectFB context
to draw my DFB graphics, my code are initialized after the video
thread and my graphic are shown OK over the video but in some
situations the video thread needs reinitialize/reconfigure DFB
context and my own DFB context don't know that this ocurred and
cannot be reinitialized, there's some way to force my DFB context
be always shown over the video even the first Directfb context was
reinitializated ?
My DirectFB initialization code snippet are bellow :
int
BackendDFB::initialize()
{
int result = 0;
bckType = BACKEND_TYPE_DIRECTFB;
dfbPicDescriptor = 0;
dfbFontDescriptor = 0;
fprintf(stderr, "Initializing DirectFB...\n");
if( DirectFBInit(NULL, NULL) != DFB_OK ) {
fprintf(stderr, "Error initializing DirectFB.\n");
result = -1;
} else {
fprintf(stderr, "DirectFB initializing OK, creating DFB
superinterface...\n");
if( DirectFBCreate( &dfb ) != DFB_OK ) {
fprintf(stderr, "Error creating DFB super interface.\n");
result = -2;
} else {
dfb->EnumDisplayLayers(dfb, dfbDisplayLayerCallback,
this);
pictMap = new PictureMap();
createDFBmainSurface(false); /*false - create surface
without create window and layer*/
}
}
return result;
}
int
BackendDFB::createDFBmainSurface(bool fromMainWindow)
{
int result = 0;
if ( ! dfb )
return -1;
if (wsurface) {
wsurface->Release(wsurface);
wsurface = NULL;
}
if (fromMainWindow) {
if (window)
window->GetSurface(window, &wsurface);
else
result = -1;
} else {
memset(&dsc, 0, sizeof(DFBSurfaceDescription));
dsc.flags = DFBSurfaceDescriptionFlags(DSDESC_CAPS |
DSDESC_PIXELFORMAT);
dsc.caps = DFBSurfaceCapabilities(DSCAPS_PRIMARY |
DSCAPS_VIDEOONLY |
DSCAPS_PREMULTIPLIED |
DSCAPS_FLIPPING);
dsc.pixelformat = DSPF_ARGB;
dfb->CreateSurface( dfb, &dsc, &wsurface );
if (wsurface) {
int w, h;
wsurface->GetSize (wsurface, &w, &h);
setWindowDimensions(0, 0, w, h);
}
}
if (wsurface) {
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, 0x00);
} else
result = -2;
return result;
}
And I will update the screen I use this function :
void
BackendDFB::update_screen()
{
if (wsurface)
wsurface->Flip(wsurface, NULL, DSFLIP_ONSYNC);
}
Thanks for all help
Flávio Alberto Lopes Soares
------------------------------------------------------------------------
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users
--
.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/ |
"------------------------------------------"
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users