~baltix/+junk/irrlicht-test

« back to all changes in this revision

Viewing changes to source/Irrlicht/CIrrDeviceStub.h

  • Committer: Mantas Kriaučiūnas
  • Date: 2011-07-18 13:06:25 UTC
  • Revision ID: mantas@akl.lt-20110718130625-c5pvifp61e7kj1ol
Included whole irrlicht SVN libraries to work around launchpad recipe issue with quilt, see https://answers.launchpad.net/launchpad/+question/165193

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
 
2
// This file is part of the "Irrlicht Engine".
 
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
 
4
 
 
5
#ifndef __C_IRR_DEVICE_STUB_H_INCLUDED__
 
6
#define __C_IRR_DEVICE_STUB_H_INCLUDED__
 
7
 
 
8
#include "IrrlichtDevice.h"
 
9
#include "IImagePresenter.h"
 
10
#include "SIrrCreationParameters.h"
 
11
#include "CVideoModeList.h"
 
12
 
 
13
namespace irr
 
14
{
 
15
        // lots of prototypes:
 
16
        class ILogger;
 
17
        class CLogger;
 
18
        class IRandomizer;
 
19
 
 
20
        namespace gui
 
21
        {
 
22
                class IGUIEnvironment;
 
23
                IGUIEnvironment* createGUIEnvironment(io::IFileSystem* fs,
 
24
                        video::IVideoDriver* Driver, IOSOperator* op);
 
25
        }
 
26
 
 
27
        namespace scene
 
28
        {
 
29
                ISceneManager* createSceneManager(video::IVideoDriver* driver,
 
30
                        io::IFileSystem* fs, gui::ICursorControl* cc, gui::IGUIEnvironment *gui);
 
31
        }
 
32
 
 
33
        namespace io
 
34
        {
 
35
                IFileSystem* createFileSystem();
 
36
        }
 
37
 
 
38
        namespace video
 
39
        {
 
40
                IVideoDriver* createSoftwareDriver(const core::dimension2d<u32>& windowSize,
 
41
                                bool fullscreen, io::IFileSystem* io,
 
42
                                video::IImagePresenter* presenter);
 
43
                IVideoDriver* createBurningVideoDriver(const irr::SIrrlichtCreationParameters& params,
 
44
                                io::IFileSystem* io, video::IImagePresenter* presenter);
 
45
                IVideoDriver* createNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize);
 
46
        }
 
47
 
 
48
 
 
49
 
 
50
        //! Stub for an Irrlicht Device implementation
 
51
        class CIrrDeviceStub : public IrrlichtDevice
 
52
        {
 
53
        public:
 
54
 
 
55
                //! constructor
 
56
                CIrrDeviceStub(const SIrrlichtCreationParameters& param);
 
57
 
 
58
                //! destructor
 
59
                virtual ~CIrrDeviceStub();
 
60
 
 
61
                //! returns the video driver
 
62
                virtual video::IVideoDriver* getVideoDriver();
 
63
 
 
64
                //! return file system
 
65
                virtual io::IFileSystem* getFileSystem();
 
66
 
 
67
                //! returns the gui environment
 
68
                virtual gui::IGUIEnvironment* getGUIEnvironment();
 
69
 
 
70
                //! returns the scene manager
 
71
                virtual scene::ISceneManager* getSceneManager();
 
72
 
 
73
                //! \return Returns a pointer to the mouse cursor control interface.
 
74
                virtual gui::ICursorControl* getCursorControl();
 
75
 
 
76
                //! Returns a pointer to a list with all video modes supported by the gfx adapter.
 
77
                virtual video::IVideoModeList* getVideoModeList();
 
78
 
 
79
                //! Returns a pointer to the ITimer object. With it the current Time can be received.
 
80
                virtual ITimer* getTimer();
 
81
 
 
82
                //! Returns the version of the engine.
 
83
                virtual const char* getVersion() const;
 
84
 
 
85
                //! send the event to the right receiver
 
86
                virtual bool postEventFromUser(const SEvent& event);
 
87
 
 
88
                //! Sets a new event receiver to receive events
 
89
                virtual void setEventReceiver(IEventReceiver* receiver);
 
90
 
 
91
                //! Returns pointer to the current event receiver. Returns 0 if there is none.
 
92
                virtual IEventReceiver* getEventReceiver();
 
93
 
 
94
                //! Sets the input receiving scene manager.
 
95
                /** If set to null, the main scene manager (returned by GetSceneManager()) will receive the input */
 
96
                virtual void setInputReceivingSceneManager(scene::ISceneManager* sceneManager);
 
97
 
 
98
                //! Returns a pointer to the logger.
 
99
                virtual ILogger* getLogger();
 
100
 
 
101
                //! Provides access to the engine's currently set randomizer.
 
102
                virtual IRandomizer* getRandomizer() const;
 
103
 
 
104
                //! Sets a new randomizer.
 
105
                virtual void setRandomizer(IRandomizer* r);
 
106
 
 
107
                //! Creates a new default randomizer.
 
108
                virtual IRandomizer* createDefaultRandomizer() const;
 
109
 
 
110
                //! Returns the operation system opertator object.
 
111
                virtual IOSOperator* getOSOperator();
 
112
 
 
113
                //! Checks if the window is running in fullscreen mode.
 
114
                virtual bool isFullscreen() const;
 
115
 
 
116
                //! get color format of the current window
 
117
                virtual video::ECOLOR_FORMAT getColorFormat() const;
 
118
 
 
119
                //! Activate any joysticks, and generate events for them.
 
120
                virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
 
121
 
 
122
                //! Set the current Gamma Value for the Display
 
123
                virtual bool setGammaRamp( f32 red, f32 green, f32 blue, f32 brightness, f32 contrast );
 
124
 
 
125
                //! Get the current Gamma Value for the Display
 
126
                virtual bool getGammaRamp( f32 &red, f32 &green, f32 &blue, f32 &brightness, f32 &contrast );
 
127
 
 
128
                //! Set the maximal elapsed time between 2 clicks to generate doubleclicks for the mouse. It also affects tripleclick behaviour.
 
129
                //! When set to 0 no double- and tripleclicks will be generated.
 
130
                virtual void setDoubleClickTime( u32 timeMs );
 
131
 
 
132
                //! Get the maximal elapsed time between 2 clicks to generate double- and tripleclicks for the mouse.
 
133
                virtual u32 getDoubleClickTime() const;
 
134
 
 
135
                //! Remove all messages pending in the system message loop
 
136
                virtual void clearSystemMessages();
 
137
 
 
138
 
 
139
        protected:
 
140
 
 
141
                void createGUIAndScene();
 
142
 
 
143
                //! checks version of SDK and prints warning if there might be a problem
 
144
                bool checkVersion(const char* version);
 
145
 
 
146
                //! Compares to the last call of this function to return double and triple clicks.
 
147
                //! \return Returns only 1,2 or 3. A 4th click will start with 1 again.
 
148
                virtual u32 checkSuccessiveClicks(s32 mouseX, s32 mouseY, EMOUSE_INPUT_EVENT inputEvent );
 
149
 
 
150
                void calculateGammaRamp ( u16 *ramp, f32 gamma, f32 relativebrightness, f32 relativecontrast );
 
151
                void calculateGammaFromRamp ( f32 &gamma, const u16 *ramp );
 
152
 
 
153
                video::IVideoDriver* VideoDriver;
 
154
                gui::IGUIEnvironment* GUIEnvironment;
 
155
                scene::ISceneManager* SceneManager;
 
156
                ITimer* Timer;
 
157
                gui::ICursorControl* CursorControl;
 
158
                IEventReceiver* UserReceiver;
 
159
                CLogger* Logger;
 
160
                IOSOperator* Operator;
 
161
                IRandomizer* Randomizer;
 
162
                io::IFileSystem* FileSystem;
 
163
                scene::ISceneManager* InputReceivingSceneManager;
 
164
 
 
165
                struct SMouseMultiClicks
 
166
                {
 
167
                        SMouseMultiClicks()
 
168
                                : DoubleClickTime(500), CountSuccessiveClicks(0), LastClickTime(0), LastMouseInputEvent(EMIE_COUNT)
 
169
                        {}
 
170
 
 
171
                        u32 DoubleClickTime;
 
172
                        u32 CountSuccessiveClicks;
 
173
                        u32 LastClickTime;
 
174
                        core::position2di LastClick;
 
175
                        EMOUSE_INPUT_EVENT LastMouseInputEvent;
 
176
                };
 
177
                SMouseMultiClicks MouseMultiClicks;
 
178
                video::CVideoModeList VideoModeList;
 
179
                SIrrlichtCreationParameters CreationParams;
 
180
                bool Close;
 
181
        };
 
182
 
 
183
} // end namespace irr
 
184
 
 
185
#endif
 
186