Irrlicht 3D Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IrrlichtDevice.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2012 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 __I_IRRLICHT_DEVICE_H_INCLUDED__
6 #define __I_IRRLICHT_DEVICE_H_INCLUDED__
7 
8 #include "IReferenceCounted.h"
9 #include "dimension2d.h"
10 #include "IVideoDriver.h"
11 #include "EDriverTypes.h"
12 #include "EDeviceTypes.h"
13 #include "IEventReceiver.h"
14 #include "ICursorControl.h"
15 #include "IVideoModeList.h"
16 #include "ITimer.h"
17 #include "IOSOperator.h"
18 
19 namespace irr
20 {
21  class ILogger;
22  class IEventReceiver;
23  class IRandomizer;
24 
25  namespace io {
26  class IFileSystem;
27  } // end namespace io
28 
29  namespace gui {
30  class IGUIEnvironment;
31  } // end namespace gui
32 
33  namespace scene {
34  class ISceneManager;
35  } // end namespace scene
36 
38 
43  class IrrlichtDevice : public virtual IReferenceCounted
44  {
45  public:
46 
48 
72  virtual bool run() = 0;
73 
75 
77  virtual void yield() = 0;
78 
80 
84  virtual void sleep(u32 timeMs, bool pauseTimer=false) = 0;
85 
87 
88  virtual video::IVideoDriver* getVideoDriver() = 0;
89 
91 
92  virtual io::IFileSystem* getFileSystem() = 0;
93 
95 
97 
99 
100  virtual scene::ISceneManager* getSceneManager() = 0;
101 
103 
104  virtual gui::ICursorControl* getCursorControl() = 0;
105 
107 
108  virtual ILogger* getLogger() = 0;
109 
111 
120 
122 
127  virtual IOSOperator* getOSOperator() = 0;
128 
130 
133  virtual ITimer* getTimer() = 0;
134 
136 
137  virtual IRandomizer* getRandomizer() const =0;
138 
140 
143  virtual void setRandomizer(IRandomizer* r) =0;
144 
146 
149  virtual IRandomizer* createDefaultRandomizer() const =0;
150 
152 
153  virtual void setWindowCaption(const wchar_t* text) = 0;
154 
156 
171  virtual bool isWindowActive() const = 0;
172 
174 
175  virtual bool isWindowFocused() const = 0;
176 
178 
179  virtual bool isWindowMinimized() const = 0;
180 
182 
183  virtual bool isFullscreen() const = 0;
184 
186 
187  virtual video::ECOLOR_FORMAT getColorFormat() const = 0;
188 
190 
191  virtual void closeDevice() = 0;
192 
194 
197  virtual const c8* getVersion() const = 0;
198 
200 
204  virtual void setEventReceiver(IEventReceiver* receiver) = 0;
205 
207 
208  virtual IEventReceiver* getEventReceiver() = 0;
209 
211 
216  virtual bool postEventFromUser(const SEvent& event) = 0;
217 
219 
222  virtual void setInputReceivingSceneManager(scene::ISceneManager* sceneManager) = 0;
223 
225 
228  virtual void setResizable(bool resize=false) = 0;
229 
231  virtual void minimizeWindow() =0;
232 
234  virtual void maximizeWindow() =0;
235 
237  virtual void restoreWindow() =0;
238 
240 
247  virtual bool activateJoysticks(core::array<SJoystickInfo>& joystickInfo) =0;
248 
250  virtual bool setGammaRamp(f32 red, f32 green, f32 blue,
251  f32 relativebrightness, f32 relativecontrast) =0;
252 
254  virtual bool getGammaRamp(f32 &red, f32 &green, f32 &blue,
255  f32 &brightness, f32 &contrast) =0;
256 
258 
267  virtual void clearSystemMessages() = 0;
268 
270 
272  virtual E_DEVICE_TYPE getType() const = 0;
273 
275 
278  {
279  switch (driver)
280  {
281  case video::EDT_NULL:
282  return true;
283  case video::EDT_SOFTWARE:
284 #ifdef _IRR_COMPILE_WITH_SOFTWARE_
285  return true;
286 #else
287  return false;
288 #endif
290 #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
291  return true;
292 #else
293  return false;
294 #endif
296 #ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
297  return true;
298 #else
299  return false;
300 #endif
302 #ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
303  return true;
304 #else
305  return false;
306 #endif
307  case video::EDT_OPENGL:
308 #ifdef _IRR_COMPILE_WITH_OPENGL_
309  return true;
310 #else
311  return false;
312 #endif
313  default:
314  return false;
315  }
316  }
317  };
318 
319 } // end namespace irr
320 
321 #endif
322