#pragma hdrstop
#endif
+#ifndef WX_PRECOMP
+ #include "wx/intl.h"
+ #include "wx/log.h"
+#endif
+
#include "wx/dfb/wrapdfb.h"
//-----------------------------------------------------------------------------
// these are programming errors, assert:
#define DFB_ASSERT(code) \
case code: \
- wxFAIL_MSG( _T("DirectFB error: ") _T(#code) ); \
+ wxFAIL_MSG( "DirectFB error: " _T(#code) ); \
return false \
DFB_ASSERT(DFB_DEAD);
wxIDirectFBSurfacePtr wxIDirectFB::GetPrimarySurface()
{
- wxIDirectFBDisplayLayerPtr layer(GetDisplayLayer());
- return layer ? layer->GetSurface() : NULL;
+ DFBSurfaceDescription desc;
+ desc.flags = DSDESC_CAPS;
+ desc.caps = DSCAPS_PRIMARY;
+ return CreateSurface(&desc);
}
//-----------------------------------------------------------------------------
// wxIDirectFBSurface
//-----------------------------------------------------------------------------
+DFBSurfacePixelFormat wxIDirectFBSurface::GetPixelFormat()
+{
+ DFBSurfacePixelFormat format = DSPF_UNKNOWN;
+ GetPixelFormat(&format);
+ return format;
+}
+
int wxIDirectFBSurface::GetDepth()
{
DFBSurfacePixelFormat format = DSPF_UNKNOWN;
return NULL;
}
- wxCHECK_MSG( size.x > 0 && size.y > 0, NULL, _T("invalid size") );
+ wxCHECK_MSG( size.x > 0 && size.y > 0, NULL, "invalid size" );
DFBSurfaceDescription desc;
desc.flags = (DFBSurfaceDescriptionFlags)(
// 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)
+ );
+}