/*
 * 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.
 *
 */

#ifndef KEOS_PREREQUISITES_H
#define KEOS_PREREQUISITES_H

// Platform-specific stuff
#include "KeosPlatform.h"

/* Include all the standard header *after* all the configuration
 * settings have been made.
 */
#include "KeosStdHeaders.h"

// Memory manager - DEBUG mode only
#include "KeosMemoryManager.h"

// Other includes
#include "KeosEnums.h"
#include "KeosVector2.h"
#include "KeosVector3.h"
#include "KeosVector4.h"
#include "KeosSmartPtr.h"

namespace Keos {

    // Define ogre version
    #define KEOS_VERSION_MAJOR 0
    #define KEOS_VERSION_MINOR 5
    #define KEOS_VERSION_PATCH 0
    #define KEOS_VERSION_NAME "Noel"
    
    #ifdef GCC_3_1
    #   define HashMap ::__gnu_cxx::hash_map
    #else
    #   if KEOS_COMPILER == KEOS_COMPILER_MSVC
    #       if KEOS_COMP_VER > 1300 && !defined(_STLP_MSVC)
    #           define HashMap ::stdext::hash_map
    #       else
    #           define HashMap ::std::hash_map
    #       endif
    #   else
    #       define HashMap ::std::hash_map
    #   endif
    #endif

    /// Useful macros
    #define KEOS_DELETE(p)       { if(p) { delete (p);     (p)=NULL; } }
    #define KEOS_DELETE_ARRAY(p) { if(p) { delete[] (p);   (p)=NULL; } }

    // Useful typedef
    typedef float Real;
	typedef std::string String;
    typedef unsigned char uchar;
    typedef unsigned short ushort;
    typedef unsigned int uint;  
	typedef unsigned long ulong;  
    typedef std::vector<String> StringVector;
	typedef std::map<String, String> SettingsMap;

    #if KEOS_COMPILER == KEOS_COMPILER_MSVC && KEOS_COMP_VER == MSVC_VER_6
    #define size_t size_t
    #else
    #define size_t std::size_t
    #endif

    #if KEOS_DEBUG_MODE
    #define KEOS_OGL_LIB "RenderSystem_OpenGL_d.dll"
    #define KEOS_D3D9_LIB "RenderSystem_Direct3D9_d.dll"
    #else
    #define KEOS_OGL_LIB "RenderSystem_OpenGL.dll"
    #define KEOS_D3D9_LIB "RenderSystem_Direct3D9.dll"
    #endif

    #define KEOS_CONFIG_FILE "config.xml"
    #define KEOS_LOG_FILE "keos.log"
    #define KEOS_MEMLEAKS_FILE "memoryleaks.log"

// Pre-declare classes
// Allows use of pointers in header files without including individual .h
// so decreases dependencies between files
    class CException;
    class CMemoryManager;
    class ILogger;
    class CLoggerFile;
    class CFile;
    class CDynLib;
    class CDynLibManager;
    class IRenderSystem;
    class IRenderWindow;
    class IRenderTarget;
    struct CAssertException;
    struct CBadDelete;
    struct CLoadingFailed;
    struct COutOfMemory;
    struct CUnsupported;
    struct CBadConversion;
    class CRoot;
    class CTimer;
    class CPlatformManager;
    class IBufferBase;
    class CMatrix4;
    class IDeclaration;
    class CColor;
    class CRenderSystemCapabilities;
    class CResourceManager;
    class IResource;
    class CModel;
    template <class T> class CVector2;
    template <class T> class CVector3;
    template <class T> class CVector4;
    template <class T> class CBuffer;
    template <class T> class ILoader;
    template <class T, template <class> class Ownership> class CSmartPtr;
    class CMediaManager;
    class CResourceManager; 
    class CImage;
    class CRectangle;
    class ITextureBase;
    class CTexture;
    class CFontManager;
    class CGraphicString;
    class CConsole;
	namespace Console 
	{ 
		class IFunction;
		class CFunctor;
		class ILook;
		class CLookDefault;
	}
    class IConfigDialog;
    class IErrorDialog;
    class CMD2Loader;
    class CMDLQ1Loader;
	class IShaderBase;
	class CShader;
	class CShadersLoader;
}

#endif // KEOS_PREREQUISITES_H


