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 //======================================================================= 00032 // CPlatformManager implementation 00033 //======================================================================= 00034 00035 //----------------------------------------------------------------------- 00036 CPlatformManager::CPlatformManager() 00037 { 00038 // Load library 00039 CDynLib* lib = CDynLibManager::Instance().Load(KEOS_PLATFORM_LIB); 00040 00041 m_pfCreateTimer = (DLL_CREATETIMER)lib->GetSymbol("createTimer"); 00042 m_pfCreateConfigDialog = (DLL_CREATECONFIGDIALOG)lib->GetSymbol("createPlatformConfigDialog"); 00043 m_pfCreateErrorDialog = (DLL_CREATEERRORDIALOG)lib->GetSymbol("createPlatformErrorDialog"); 00044 00045 m_pfDestroyTimer = (DLL_DESTROYTIMER)lib->GetSymbol("destroyTimer"); 00046 m_pfDestroyConfigDialog = (DLL_DESTROYCONFIGDIALOG)lib->GetSymbol("destroyPlatformConfigDialog"); 00047 m_pfDestroyErrorDialog = (DLL_DESTROYERRORDIALOG)lib->GetSymbol("destroyPlatformErrorDialog"); 00048 00049 m_pfGetVideoModeList = (DLL_GETVIDEOMODELIST)lib->GetSymbol("getVideoModeList"); 00050 } 00051 00052 //----------------------------------------------------------------------- 00053 CTimer* CPlatformManager::CreateTimer() 00054 { 00055 // Delegate 00056 CTimer* pTimer; 00057 m_pfCreateTimer(&pTimer); 00058 return pTimer; 00059 } 00060 00061 //----------------------------------------------------------------------- 00062 void CPlatformManager::DestroyTimer(CTimer* timer) 00063 { 00064 m_pfDestroyTimer(timer); 00065 } 00066 00067 //----------------------------------------------------------------------- 00068 IConfigDialog* CPlatformManager::CreateConfigDialog() 00069 { 00070 IConfigDialog* pdlg; 00071 m_pfCreateConfigDialog(&pdlg); 00072 return pdlg; 00073 } 00074 00075 //----------------------------------------------------------------------- 00076 IErrorDialog* CPlatformManager::CreateErrorDialog() 00077 { 00078 IErrorDialog* pdlg; 00079 m_pfCreateErrorDialog(&pdlg); 00080 return pdlg; 00081 } 00082 00083 //----------------------------------------------------------------------- 00084 void CPlatformManager::DestroyConfigDialog(IConfigDialog* pDlg) 00085 { 00086 m_pfDestroyConfigDialog(pDlg); 00087 } 00088 00089 //----------------------------------------------------------------------- 00090 void CPlatformManager::DestroyErrorDialog(IErrorDialog* pDlg) 00091 { 00092 m_pfDestroyErrorDialog(pDlg); 00093 } 00094 00095 //----------------------------------------------------------------------- 00096 void CPlatformManager::GetVideoModeList(StringVector* pList) 00097 { 00098 m_pfGetVideoModeList(pList); 00099 } 00100 00101 } // namespace Keos
1.5.1-p1