/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2008.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: include/sgx/core/gamecode/base_engine.hpp

*/

#ifndef SGX_GAMECODE_BASE_ENGINE_HPP
#define SGX_GAMECODE_BASE_ENGINE_HPP	1

/**
Note: We derive engine from CGameHandler to ensure it includes all the
standard method calls that could be made from the registerObjected objects.
*/
class CSGXBaseEngine : public CGameObject {
public:
	CSGXBaseEngine();

	virtual tBOOL	registerGlobalObject(CGameHandler *ptr);
	virtual tBOOL	unregisterGlobalObject(CGameHandler *ptr);
	virtual void	unregisterGlobalObjects();

	virtual tBOOL	registerObject(CGameHandler *ptr);
	virtual tBOOL	unregisterObject(CGameHandler *ptr);
	virtual void	unregisterObjects();

	virtual void	unregisterAllObjects();

	virtual void	initialize();
	virtual void	suspend(const tUINT32 frames=2);
	virtual void	resume();
	virtual void	release();

	virtual tBOOL	isSuspended();

	virtual void	releaseGameObjects();
	virtual void	releaseGlobalObjects();

	virtual void	preUpdate(const tREAL32 t);
	virtual void	update(const tREAL32 t);
	virtual void	postUpdate(const tREAL32 t);

	virtual void	preDraw() const;
	virtual void	draw() const;
	virtual void	postDraw() const;

protected:
	sgxVector<CGameHandler *>	m_EngineObjects;
	sgxVector<CGameHandler *>	m_GlobalObjects;

	tUINT32						m_SuspendCount;
};


#endif /* #define SGX_GAMECODE_BASE_ENGINE_HPP */
