CIrrDeviceStub Class Reference

#include <CIrrDeviceStub.h>

Inheritance diagram for CIrrDeviceStub:

IrrlichtDevice IrrUnknown

Public Member Functions

Protected Member Functions

Protected Attributes


Constructor & Destructor Documentation

CIrrDeviceStub ( const char *  version,
irr::IEventReceiver resv 
)

~CIrrDeviceStub (  )  [virtual]


Member Function Documentation

bool checkVersion ( const char *  version  )  [protected]

virtual void closeDevice (  )  [pure virtual, inherited]

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

void createGUIAndScene (  )  [protected]

bool drop (  )  [inline, inherited]

Drops the object. Decrements the reference counter by one. Returns true, if the object was deleted. The IrrUnknown class provides a basic reference counting mechanism with its methods grab() and drop(). Most objects of the Irrlicht Engine are derived from IrrUnknown, and so they are reference counted.

When you create an object in the Irrlicht engine, calling a method which starts with 'create', an object is created, and you get a pointer to the new object. If you no longer need the object, you have to call drop(). This will destroy the object, if grab() was not called in another part of you program, because this part still needs the object. Note, that you only need to call drop() to the object, if you created it, and the method had a 'create' in it.

A simple example:

If you want to create a texture, you may want to call an imaginable method IDriver::createTexture. You call ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128)); If you no longer need the texture, call texture->drop(). If you want to load a texture, you may want to call imaginable method IDriver::loadTexture. You do this like ITexture* texture = driver->loadTexture("example.jpg"); You will not have to drop the pointer to the loaded texture, because the name of the method does not start with 'create'. The texture is stored somewhere by the driver.

gui::ICursorControl * getCursorControl (  )  [virtual]

Implements IrrlichtDevice.

const c8* getDebugName (  )  const [inline, inherited]

Returns the debug name of the object. The Debugname may only be set and changed by the object itself. This method should only be used in Debug mode.

Returns:
Returns a string, previously set by setDebugName();

IEventReceiver * getEventReceiver (  )  [virtual]

Implements IrrlichtDevice.

io::IFileSystem * getFileSystem (  )  [virtual]

Implements IrrlichtDevice.

gui::IGUIEnvironment * getGUIEnvironment (  )  [virtual]

Implements IrrlichtDevice.

ILogger * getLogger (  )  [virtual]

Implements IrrlichtDevice.

IOSOperator * getOSOperator (  )  [virtual]

Implements IrrlichtDevice.

scene::ISceneManager * getSceneManager (  )  [virtual]

Implements IrrlichtDevice.

ITimer * getTimer (  )  [virtual]

Returns:
Returns a pointer to the ITimer object. With it the current Time can be received.

Implements IrrlichtDevice.

const char * getVersion (  )  [virtual]

Implements IrrlichtDevice.

video::IVideoDriver * getVideoDriver (  )  [virtual]

Implements IrrlichtDevice.

video::IVideoModeList * getVideoModeList (  )  [virtual]

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

Implements IrrlichtDevice.

void grab (  )  [inline, inherited]

Grabs the object. Increments the reference counter by one. Someone who calls grab() to an object, should later also call drop() to it. If an object never gets as much drop() as grab() calls, it will never be destroyed. The IrrUnknown class provides a basic reference counting mechanism with its methods grab() and drop(). Most objects of the Irrlicht Engine are derived from IrrUnknown, and so they are reference counted.

When you create an object in the Irrlicht engine, calling a method which starts with 'create', an object is created, and you get a pointer to the new object. If you no longer need the object, you have to call drop(). This will destroy the object, if grab() was not called in another part of you program, because this part still needs the object. Note, that you only need to call drop() to the object, if you created it, and the method had a 'create' in it.

A simple example:

If you want to create a texture, you may want to call an imaginable method IDriver::createTexture. You call ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128)); If you no longer need the texture, call texture->drop(). If you want to load a texture, you may want to call imaginable method IDriver::loadTexture. You do this like ITexture* texture = driver->loadTexture("example.jpg"); You will not have to drop the pointer to the loaded texture, because the name of the method does not start with 'create'. The texture is stored somewhere by the driver.

virtual bool isWindowActive (  )  [pure virtual, inherited]

Returns:
Returns true if window is active. If the window is inactive, nothing need 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
  }

void postEventFromUser ( const SEvent event  )  [virtual]

Implements IrrlichtDevice.

virtual bool run (  )  [pure virtual, inherited]

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 this slightly enhanced code instead:
while(device->run())
  if(device->isWindowActive())
  {
    // draw everything here
  }
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 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.

void setDebugName ( const c8 newName  )  [inline, protected, inherited]

Sets the debug name of the object. The Debugname may only be set and changed by the object itself. This method should only be used in Debug mode.

Parameters:
newName,: New debug name to set.

void setEventReceiver ( IEventReceiver receiver  )  [virtual]

Implements IrrlichtDevice.

void setResizeAble ( bool  resize = false  )  [virtual]

Sets if the window should be resizeable in windowed mode. The default is false.

Implements IrrlichtDevice.

virtual void setWindowCaption ( const wchar_t *  text  )  [pure virtual, inherited]

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


Field Documentation

gui::ICursorControl* CursorControl [protected]

io::IFileSystem* FileSystem [protected]

gui::IGUIEnvironment* GUIEnvironment [protected]

CLogger* Logger [protected]

IOSOperator* Operator [protected]

scene::ISceneManager* SceneManager [protected]

ITimer* Timer [protected]

IEventReceiver* UserReceiver [protected]

video::IVideoDriver* VideoDriver [protected]

video::CVideoModeList VideoModeList [protected]


Generated on Fri Apr 27 14:47:01 2007 for IrrSpintz by  doxygen 1.5.1-p1