#ifndef __PROJAPP_HPP__
#define __PROJAPP_HPP__

/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/

/* here are the directive you must respect when changing this file :

* === don't use malloc, but use memory module functions
* === absolutely no file handling in this file
* === always specify 'void' keyword for functions parameters and return value
* === take care of upper / lower case for #include and other filenames     
* === NO C++ style comentary
* === NO ASSERT, use error module equivalent function

*/


/***************************************************************
/	WIN32 PLATFORM
***************************************************************/
#ifdef WIN32			/* WIN32 platform*/

#include "ITF.h"

//
// Definition of project application
//
class _ProjectApp : public CPA_ProjectApp
{
public:
 void fn_vUpdateFrameTitle(void);
 void fn_vCreateEngineThread(void);
	void	fn_vWhenAppGainFocus(void);
	void	fn_vWhenAppLooseFocus(void);
	void	fn_vBeforeEngineStarts(void);
	void	fn_vAfterEngineStops(void);
	void	fn_vDynaFatalError(char *);
	BOOL	InitApplication(void);
	void	ExitApplication(void);
	BOOL	InitInstance(void);
 void fn_vReinitCurrentMap(void);

#ifdef ACTIVE_EDITOR
	void	fn_vUpdateDynamicLights (void);
	void	fn_vFindDynamicLights (HIE_tdxHandleToSuperObject hCharacter, long *lNbLights, GLI_tdxHandleToLight a_hLights[]);
 BOOL    fn_bActivateDLL(char *szDLLName);
	BOOL    fn_bTreatAppKeyboard(UINT);
#endif
};
extern _ProjectApp theApp;  // One instance of application

//***************************************************************
//	OTHER PLATFORM
//***************************************************************
#else	/*WIN32				 other platform than WIN32*/

/*
 *	Constants for device (screen) parameters
 */
#define C_dwScreenWidth			640
#define	C_dwScreenHeight		480
#define C_dwScreenDepth			8

/*
 *	globals for device and viewport
 */
extern GLD_tdhDevice	g_hDeviceHandle;		
extern GLD_tdhViewport	g_hViewport;

/*
 *	Macros
 */
#define M_GetMainGLDDevice( num ) (&g_hDeviceHandle)
#define M_GetMainGLDViewport( num ) (&g_hViewport )

/*
 *	Functions
 */

/* project entrance : main function*/
int main( int argc, char *argv[] );

/* creation of main screen display*/
BOOL fn_bCreateMainDisplayScreen( void );

#endif  /* WIN32*/

/***************************************************************
	ALL PLATFORM
***************************************************************/

/* initialization/destruction of project*/
BOOL fn_bInitApplication( void );
void fn_vExitApplication( void );


#endif /* __PROJAPP_HPP__*/