/*
 * This source file is part of KEOS (Free 3D Engine)
 * For the latest info, see http://www.keosengine.org/
 * E-mails : thierry.vouriot@keosengine.org, yeri@keosengine.org
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307, USA, or go to
 * http://www.gnu.org/copyleft/lesser.txt.
 *
 */

#include "KeosWin32Timer.h"
#include "KeosWin32ConfigDialog.h"
#include "KeosWin32ErrorDialog.h"

namespace Keos 
{
	// Creates a Timer using default implementation
	extern "C" void createTimer(CTimer** ppTimer)
	{
	    *ppTimer = new CWin32Timer();
        (*ppTimer)->Reset();
	}

    // Destroy a Timer
    extern "C" void destroyTimer(CTimer* pTimer)
	{
	    delete pTimer;
	}

    // Retrieves an instance of a config dialog
    extern "C" void createPlatformConfigDialog(IConfigDialog** ppDlg)
    {
        HINSTANCE hInst = GetModuleHandle(KEOS_PLATFORM_LIB);
        *ppDlg = new CWin32ConfigDialog(hInst);
    }

    // Destroy a IConfigDialog
    extern "C" void destroyPlatformConfigDialog(IConfigDialog* pDlg)
    {
        delete pDlg;
    }

    // Retrieves an instance of a error dialog
    extern "C" void createPlatformErrorDialog(IErrorDialog** ppDlg)
    {
        HINSTANCE hInst = GetModuleHandle(KEOS_PLATFORM_LIB);
        *ppDlg = new CWin32ErrorDialog(hInst);
    }

    // Destroy a IErrorDialog
    extern "C" void destroyPlatformErrorDialog(IErrorDialog* pDlg)
    {
        delete pDlg;
    }
  
} // namespace Keos
