Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members

irr::IrrlichtDevice Class Reference

The Irrlicht device. You can create it with createDevice() or createDeviceEx(). More...

#include <IrrlichtDevice.h>

Inheritance diagram for irr::IrrlichtDevice:

irr::IReferenceCounted List of all members.

Public Member Functions

virtual void closeDevice ()=0
 Notifies the device that it should close itself.
virtual gui::ICursorControlgetCursorControl ()=0
 Provides access to the cursor control.
virtual IEventReceivergetEventReceiver ()=0
 Provides access to the current event receiver.
virtual io::IFileSystemgetFileSystem ()=0
 Provides access to the virtual file system.
virtual gui::IGUIEnvironmentgetGUIEnvironment ()=0
 Provides access to the 2d user interface environment.
virtual ILoggergetLogger ()=0
 Provides access to the message logger.
virtual IOSOperatorgetOSOperator ()=0
 Provides access to the operation system operator object.
virtual scene::ISceneManagergetSceneManager ()=0
 Provides access to the scene manager.
virtual ITimergetTimer ()=0
 Provides access to the engine's timer.
virtual const c8getVersion () const =0
 Get the version of the engine.
virtual video::IVideoDrivergetVideoDriver ()=0
 Provides access to the video driver for drawing 3d and 2d geometry.
virtual video::IVideoModeListgetVideoModeList ()=0
 Gets a list with all video modes available.
virtual bool isWindowActive () const =0
 Returns if the window is active.
virtual bool postEventFromUser (const SEvent &event)=0
 Sends a user created event to the engine.
virtual bool run ()=0
 Runs the device.
virtual void setEventReceiver (IEventReceiver *receiver)=0
 Sets a new event receiver to receive events.
virtual void setInputReceivingSceneManager (scene::ISceneManager *sceneManager)=0
 Sets the input receiving scene manager.
virtual void setResizeAble (bool resize=false)=0
 Sets if the window should be resizeable in windowed mode.
virtual void setWindowCaption (const wchar_t *text)=0
 Sets the caption of the window.
virtual void sleep (u32 timeMs, bool pauseTimer=false)=0
 Pause execution and let other processes to run for a specified amount of time.
virtual void yield ()=0
 Cause the device to temporarily pause execution and let other processes run.
virtual ~IrrlichtDevice ()
 Destructor.

Detailed Description

The Irrlicht device. You can create it with createDevice() or createDeviceEx().

This is the most important class of the Irrlicht Engine. You can access everything in the engine if you have a pointer to an instance of this class. There should be only one instance of this class at any time.

Definition at line 40 of file IrrlichtDevice.h.


Constructor & Destructor Documentation

virtual irr::IrrlichtDevice::~IrrlichtDevice  )  [inline, virtual]
 

Destructor.

Definition at line 45 of file IrrlichtDevice.h.


Member Function Documentation

virtual void irr::IrrlichtDevice::closeDevice  )  [pure virtual]
 

Notifies the device that it should close itself.

IrrlichtDevice::run() will always return false after closeDevice() was called.

virtual gui::ICursorControl* irr::IrrlichtDevice::getCursorControl  )  [pure virtual]
 

Provides access to the cursor control.

Returns:
Pointer to the mouse cursor control interface.

virtual IEventReceiver* irr::IrrlichtDevice::getEventReceiver  )  [pure virtual]
 

Provides access to the current event receiver.

Returns:
Pointer to the current event receiver. Returns 0 if there is none.

virtual io::IFileSystem* irr::IrrlichtDevice::getFileSystem  )  [pure virtual]
 

Provides access to the virtual file system.

Returns:
Pointer to the file system.

virtual gui::IGUIEnvironment* irr::IrrlichtDevice::getGUIEnvironment  )  [pure virtual]
 

Provides access to the 2d user interface environment.

Returns:
Pointer to the gui environment.

virtual ILogger* irr::IrrlichtDevice::getLogger  )  [pure virtual]
 

Provides access to the message logger.

Returns:
Pointer to the logger.

virtual IOSOperator* irr::IrrlichtDevice::getOSOperator  )  [pure virtual]
 

Provides access to the operation system operator object.

The OS operator provides methods for getting system specific informations and doing system specific operations, such as exchanging data with the clipboard or reading the operation system version.

Returns:
Pointer to the OS operator.

virtual scene::ISceneManager* irr::IrrlichtDevice::getSceneManager  )  [pure virtual]
 

Provides access to the scene manager.

Returns:
Pointer to the scene manager.

virtual ITimer* irr::IrrlichtDevice::getTimer  )  [pure virtual]
 

Provides access to the engine's timer.

The system time can be retrieved by it as well as the virtual time, which also can be manipulated.

Returns:
Pointer to the ITimer object.

virtual const c8* irr::IrrlichtDevice::getVersion  )  const [pure virtual]
 

Get the version of the engine.

The returned string will look like this: "1.2.3" or this: "1.2".

Returns:
String which contains the version.

virtual video::IVideoDriver* irr::IrrlichtDevice::getVideoDriver  )  [pure virtual]
 

Provides access to the video driver for drawing 3d and 2d geometry.

Returns:
Pointer the video driver.

virtual video::IVideoModeList* irr::IrrlichtDevice::getVideoModeList  )  [pure virtual]
 

Gets a list with all video modes available.

If you are confused now, because you think you have to create an Irrlicht Device with a video mode before being able to get the video mode list, let me tell you that there is no need to start up an Irrlicht Device with EDT_DIRECT3D8, EDT_OPENGL or EDT_SOFTWARE: For this (and for lots of other reasons) the null driver, EDT_NULL exists.

Returns:
Pointer to a list with all video modes supported by the gfx adapter.

virtual bool irr::IrrlichtDevice::isWindowActive  )  const [pure virtual]
 

Returns if the window is active.

If the window is inactive, nothing needs to be drawn. So if you don't want to draw anything when the window is inactive, create your drawing loop this way:

                while(device->run())
                {
                        if (device->isWindowActive())
                        {
                                // draw everything here
                        }
                        else
                                device->yield();
                }
Returns:
True if window is active.

virtual bool irr::IrrlichtDevice::postEventFromUser const SEvent event  )  [pure virtual]
 

Sends a user created event to the engine.

Is is usually not necessary to use this. However, if you are using an own input library for example for doing joystick input, you can use this to post key or mouse input events to the engine. Internally, this method only delegates the events further to the scene manager and the GUI environment.

virtual bool irr::IrrlichtDevice::run  )  [pure virtual]
 

Runs the device.

Also increments the virtual timer by calling ITimer::tick();. You can prevent this by calling ITimer::stop(); before and ITimer::start() after calling IrrlichtDevice::run(). Returns false if device wants to be deleted. Use it in this way:

                while(device->run())
                {
                        // draw everything here
                }
If you want the device to do nothing if the window is inactive (recommended), use the slightly enhanced code shown at isWindowActive().

Note if you are running Irrlicht inside an external, custom created window: Calling Device->run() will cause Irrlicht to dispatch windows messages internally. If you are running Irrlicht in your own custom window, you can also simply use your own message loop using GetMessage, DispatchMessage and whatever and simply don't use this method. But note that Irrlicht will not be able to fetch user input then. See irr::SIrrlichtCreationParameters::WindowId for more informations and example code.

virtual void irr::IrrlichtDevice::setEventReceiver IEventReceiver receiver  )  [pure virtual]
 

Sets a new event receiver to receive events.

Parameters:
receiver New receiver to be used.

virtual void irr::IrrlichtDevice::setInputReceivingSceneManager scene::ISceneManager sceneManager  )  [pure virtual]
 

Sets the input receiving scene manager.

If set to null, the main scene manager (returned by GetSceneManager()) will receive the input

Parameters:
sceneManager New scene manager to be used.

virtual void irr::IrrlichtDevice::setResizeAble bool  resize = false  )  [pure virtual]
 

Sets if the window should be resizeable in windowed mode.

The default is false. This method only works in windowed mode.

Parameters:
resize Flag whether the window should be resizeable.

virtual void irr::IrrlichtDevice::setWindowCaption const wchar_t *  text  )  [pure virtual]
 

Sets the caption of the window.

Parameters:
text,: New text of the window caption.

virtual void irr::IrrlichtDevice::sleep u32  timeMs,
bool  pauseTimer = false
[pure virtual]
 

Pause execution and let other processes to run for a specified amount of time.

It may not wait the full given time, as sleep may be interrupted

Parameters:
timeMs,: Time to sleep for in milisecs.
pauseTimer,: If true, pauses the device timer while sleeping

virtual void irr::IrrlichtDevice::yield  )  [pure virtual]
 

Cause the device to temporarily pause execution and let other processes run.

This should bring down processor usage without major performance loss for Irrlicht


The documentation for this class was generated from the following file:
The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2008 by Nikolaus Gebhardt. Generated on Sun Sep 21 08:57:49 2008 by Doxygen (1.4.2)