Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# KeosPlatformManager.cpp

Go to the documentation of this file.

    00001 /*
    00002  * This source file is part of KEOS (Free 3D Engine)
    00003  * For the latest info, see http://www.keosengine.org/
    00004  * E-mails : thierry.vouriot@keosengine.org, yeri@keosengine.org
    00005  *
    00006  * This program is free software; you can redistribute it and/or modify it under
    00007  * the terms of the GNU Lesser General Public License as published by the Free Software
    00008  * Foundation; either version 2 of the License, or (at your option) any later
    00009  * version.
    00010  *
    00011  * This program is distributed in the hope that it will be useful, but WITHOUT
    00012  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    00013  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    00014  *
    00015  * You should have received a copy of the GNU Lesser General Public License along with
    00016  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    00017  * Place - Suite 330, Boston, MA 02111-1307, USA, or go to
    00018  * http://www.gnu.org/copyleft/lesser.txt.
    00019  *
    00020  */
    00021
    00022 #include "KeosPlatformManager.h"
    00023
    00024 #include "KeosDynLibManager.h"
    00025 #include "KeosDynLib.h"
    00026
    00027
    00028 namespace Keos {
    00029
    00030     //=======================================================================
    00031     // CPlatformManager implementation
    00032     //=======================================================================
    00033
    00034     //-----------------------------------------------------------------------
    00035     CPlatformManager::CPlatformManager()
    00036     {
    00037         // Load library
    00038         CDynLib* lib = CDynLibManager::Instance().Load(KEOS_PLATFORM_LIB);
    00039
    00040         m_pfCreateTimer = (DLL_CREATETIMER)lib->GetSymbol("createTimer");
    00041         m_pfCreateConfigDialog = (DLL_CREATECONFIGDIALOG)lib->GetSymbol("createPlatformConfigDialog");
    00042         m_pfCreateErrorDialog = (DLL_CREATEERRORDIALOG)lib->GetSymbol("createPlatformErrorDialog");
    00043
    00044         m_pfDestroyTimer = (DLL_DESTROYTIMER)lib->GetSymbol("destroyTimer");
    00045         m_pfDestroyConfigDialog = (DLL_DESTROYCONFIGDIALOG)lib->GetSymbol("destroyPlatformConfigDialog");
    00046         m_pfDestroyErrorDialog = (DLL_DESTROYERRORDIALOG)lib->GetSymbol("destroyPlatformErrorDialog");
    00047     }
    00048
    00049     //-----------------------------------------------------------------------
    00050     CTimer* CPlatformManager::CreateTimer()
    00051     {
    00052         // Delegate
    00053         CTimer* pTimer;
    00054         m_pfCreateTimer(&pTimer);
    00055         return pTimer;
    00056     }
    00057
    00058     //-----------------------------------------------------------------------
    00059     void CPlatformManager::DestroyTimer(CTimer* timer)
    00060     {
    00061         m_pfDestroyTimer(timer);
    00062     }
    00063
    00064     //-----------------------------------------------------------------------
    00065     IConfigDialog* CPlatformManager::CreateConfigDialog()
    00066     {
    00067         IConfigDialog* pdlg;
    00068         m_pfCreateConfigDialog(&pdlg);
    00069         return pdlg;
    00070     }
    00071
    00072     //-----------------------------------------------------------------------
    00073     IErrorDialog* CPlatformManager::CreateErrorDialog()
    00074     {
    00075         IErrorDialog* pdlg;
    00076         m_pfCreateErrorDialog(&pdlg);
    00077         return pdlg;
    00078     }
    00079
    00080     //-----------------------------------------------------------------------
    00081     void CPlatformManager::DestroyConfigDialog(IConfigDialog* pDlg)
    00082     {
    00083         m_pfDestroyConfigDialog(pDlg);
    00084     }
    00085
    00086     //-----------------------------------------------------------------------
    00087     void CPlatformManager::DestroyErrorDialog(IErrorDialog* pDlg)
    00088     {
    00089         m_pfDestroyErrorDialog(pDlg);
    00090     }
    00091
    00092 } // namespace Keos