don't use priviledged calls in wxDFB to allow concurrent use of the display by >1 wxDFB apps

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2006-11-18 13:17:35 +00:00
parent c8408242c2
commit fa28b00cdc
4 changed files with 36 additions and 20 deletions

View File

@@ -98,8 +98,10 @@ void wxIDirectFB::CleanUp()
wxIDirectFBSurfacePtr wxIDirectFB::GetPrimarySurface()
{
wxIDirectFBDisplayLayerPtr layer(GetDisplayLayer());
return layer ? layer->GetSurface() : NULL;
DFBSurfaceDescription desc;
desc.flags = DSDESC_CAPS;
desc.caps = DSCAPS_PRIMARY;
return CreateSurface(&desc);
}
//-----------------------------------------------------------------------------
@@ -192,3 +194,26 @@ bool wxIDirectFBSurface::FlipToFront(const DFBRegion *region)
// drawings:
return Flip(region, DSFLIP_BLIT);
}
//-----------------------------------------------------------------------------
// wxIDirectFBDisplayLayer
//-----------------------------------------------------------------------------
wxVideoMode wxIDirectFBDisplayLayer::GetVideoMode()
{
DFBDisplayLayerConfig cfg;
if ( !GetConfiguration(&cfg) )
return wxVideoMode(); // invalid
if ( !((cfg.flags & DLCONF_WIDTH) &&
(cfg.flags & DLCONF_HEIGHT) &&
(cfg.flags & DLCONF_PIXELFORMAT)) )
return wxVideoMode(); // invalid
return wxVideoMode
(
cfg.width,
cfg.height,
DFB_BITS_PER_PIXEL(cfg.pixelformat)
);
}