#ifndef __C_IRR_DEVICE_STUB_H_INCLUDED__
#define __C_IRR_DEVICE_STUB_H_INCLUDED__
#include "IrrlichtDevice.h"
#include "IImagePresenter.h"
#include "SIrrCreationParameters.h"
#include "CVideoModeList.h"
namespace irr
{
class ILogger;
class CLogger;
namespace gui
{
class IGUIEnvironment;
IGUIEnvironment* createGUIEnvironment(io::IFileSystem* fs,
video::IVideoDriver* Driver, IOSOperator* op);
}
namespace scene
{
ISceneManager* createSceneManager(video::IVideoDriver* driver,
io::IFileSystem* fs, gui::ICursorControl* cc, gui::IGUIEnvironment *gui);
}
namespace io
{
IFileSystem* createFileSystem();
}
namespace video
{
IVideoDriver* createSoftwareDriver(const core::dimension2d<u32>& windowSize,
bool fullscreen, io::IFileSystem* io,
video::IImagePresenter* presenter);
IVideoDriver* createBurningVideoDriver(const irr::SIrrlichtCreationParameters& params,
io::IFileSystem* io, video::IImagePresenter* presenter);
IVideoDriver* createNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize);
}
class CIrrDeviceStub : public IrrlichtDevice
{
public:
CIrrDeviceStub(const SIrrlichtCreationParameters& param);
virtual ~CIrrDeviceStub();
virtual video::IVideoDriver* getVideoDriver();
virtual io::IFileSystem* getFileSystem();
virtual gui::IGUIEnvironment* getGUIEnvironment();
virtual scene::ISceneManager* getSceneManager();
virtual gui::ICursorControl* getCursorControl();
virtual video::IVideoModeList* getVideoModeList();
virtual ITimer* getTimer();
virtual const char* getVersion() const;
virtual bool postEventFromUser(const SEvent& event);
virtual void setEventReceiver(IEventReceiver* receiver);
virtual IEventReceiver* getEventReceiver();
virtual void setInputReceivingSceneManager(scene::ISceneManager* sceneManager);
virtual ILogger* getLogger();
virtual IOSOperator* getOSOperator();
virtual bool isFullscreen() const;
virtual video::ECOLOR_FORMAT getColorFormat() const;
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
virtual bool setGammaRamp( f32 red, f32 green, f32 blue, f32 brightness, f32 contrast );
virtual bool getGammaRamp( f32 &red, f32 &green, f32 &blue, f32 &brightness, f32 &contrast );
virtual void setDoubleClickTime( u32 timeMs );
virtual u32 getDoubleClickTime() const;
virtual void clearSystemMessages();
protected:
void createGUIAndScene();
bool checkVersion(const char* version);
virtual u32 checkSuccessiveClicks(s32 mouseX, s32 mouseY, EMOUSE_INPUT_EVENT inputEvent );
void calculateGammaRamp ( u16 *ramp, f32 gamma, f32 relativebrightness, f32 relativecontrast );
void calculateGammaFromRamp ( f32 &gamma, const u16 *ramp );
video::IVideoDriver* VideoDriver;
gui::IGUIEnvironment* GUIEnvironment;
scene::ISceneManager* SceneManager;
ITimer* Timer;
gui::ICursorControl* CursorControl;
IEventReceiver* UserReceiver;
CLogger* Logger;
IOSOperator* Operator;
io::IFileSystem* FileSystem;
scene::ISceneManager* InputReceivingSceneManager;
struct SMouseMultiClicks
{
SMouseMultiClicks()
: DoubleClickTime(500), CountSuccessiveClicks(0), LastClickTime(0), LastMouseInputEvent(EMIE_COUNT)
{}
u32 DoubleClickTime;
u32 CountSuccessiveClicks;
u32 LastClickTime;
core::position2di LastClick;
EMOUSE_INPUT_EVENT LastMouseInputEvent;
};
SMouseMultiClicks MouseMultiClicks;
video::CVideoModeList VideoModeList;
SIrrlichtCreationParameters CreationParams;
bool Close;
};
}
#endif