X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3c861501a451503b31c075ccb59d16b0ae01e99..a863333e37e846223cac5dfdeaecea35c62062bd:/src/dfb/app.cpp diff --git a/src/dfb/app.cpp b/src/dfb/app.cpp index 31bdf0f350..fc5357d91f 100644 --- a/src/dfb/app.cpp +++ b/src/dfb/app.cpp @@ -39,25 +39,17 @@ wxApp::~wxApp() { } -IDirectFBPtr wxApp::GetDirectFBInterface() -{ - return m_dfb; -} - bool wxApp::Initialize(int& argc, wxChar **argv) { if ( !wxAppBase::Initialize(argc, argv) ) return false; - if ( !DFB_CALL( DirectFBInit(&argc, &argv) ) ) + if ( !wxDfbCheckReturn(DirectFBInit(&argc, &argv)) ) return false; - if ( !DFB_CALL( DirectFBCreate(&m_dfb) ) ) + if ( !wxIDirectFB::Get() ) return false; - #warning "FIXME: theme override is temporary" - wxTheme::Set(wxTheme::Create(_T("gtk"))); - return true; } @@ -65,7 +57,8 @@ void wxApp::CleanUp() { wxAppBase::CleanUp(); - m_dfb.Reset(); + wxEventLoop::CleanUp(); + wxIDirectFB::CleanUp(); } //----------------------------------------------------------------------------- @@ -76,12 +69,12 @@ static wxVideoMode GetCurrentVideoMode() { wxVideoMode m; - IDirectFBSurfacePtr surface(wxDfbGetPrimarySurface()); + wxIDirectFBSurfacePtr surface(wxIDirectFB::Get()->GetPrimarySurface()); if ( !surface ) return m; // invalid - DFB_CALL( surface->GetSize(surface, &m.w, &m.h) ); - m.bpp = wxDfbGetSurfaceDepth(surface); + surface->GetSize(&m.w, &m.h); + m.bpp = surface->GetDepth(); return m; } @@ -96,7 +89,7 @@ wxVideoMode wxApp::GetDisplayMode() const bool wxApp::SetDisplayMode(const wxVideoMode& mode) { - if ( !DFB_CALL( m_dfb->SetVideoMode(m_dfb, mode.w, mode.h, mode.bpp) ) ) + if ( !wxIDirectFB::Get()->SetVideoMode(mode.w, mode.h, mode.bpp) ) return false; m_videoMode = mode;