use C++ wrappers around DirectFB API for easier use

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41029 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2006-09-06 09:40:31 +00:00
parent 42e2bbb9e1
commit 52c8d32a71
23 changed files with 752 additions and 366 deletions

View File

@@ -39,20 +39,15 @@ 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"
@@ -65,7 +60,7 @@ void wxApp::CleanUp()
{
wxAppBase::CleanUp();
m_dfb.Reset();
wxIDirectFB::CleanUp();
}
//-----------------------------------------------------------------------------
@@ -76,11 +71,11 @@ static wxVideoMode GetCurrentVideoMode()
{
wxVideoMode m;
IDirectFBSurfacePtr surface(wxDfbGetPrimarySurface());
wxIDirectFBSurfacePtr surface(wxDfbGetPrimarySurface());
if ( !surface )
return m; // invalid
DFB_CALL( surface->GetSize(surface, &m.w, &m.h) );
surface->GetSize(&m.w, &m.h);
m.bpp = wxDfbGetSurfaceDepth(surface);
return m;
@@ -96,7 +91,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;