]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/wrapdfb.cpp
compilation fix for gcc 3.3
[wxWidgets.git] / src / dfb / wrapdfb.cpp
index afd6ee064b0e8a57d1fa7bfbe790dfbd5cbeebcf..f81fdb316c0b028c3ad5d9319e56c982f54d62c1 100644 (file)
     #pragma hdrstop
 #endif
 
+#ifndef WX_PRECOMP
+    #include "wx/intl.h"
+    #include "wx/log.h"
+#endif
+
 #include "wx/dfb/wrapdfb.h"
 
 //-----------------------------------------------------------------------------
@@ -98,14 +103,23 @@ 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);
 }
 
 //-----------------------------------------------------------------------------
 // wxIDirectFBSurface
 //-----------------------------------------------------------------------------
 
+DFBSurfacePixelFormat wxIDirectFBSurface::GetPixelFormat()
+{
+    DFBSurfacePixelFormat format = DSPF_UNKNOWN;
+    GetPixelFormat(&format);
+    return format;
+}
+
 int wxIDirectFBSurface::GetDepth()
 {
     DFBSurfacePixelFormat format = DSPF_UNKNOWN;
@@ -192,3 +206,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)
+           );
+}