SoftPixel Engine device interface. More...
#include <spSoftPixelDevice.hpp>
Public Member Functions | |
virtual | ~SoftPixelDevice () |
video::RenderSystem * | getRenderSystem () const |
Returns the render system. There is only one instance. | |
video::RenderContext * | getRenderContext () const |
scene::SceneManager * | getSceneManager () const |
Returns the scene manager. There is only one instance. | |
io::InputControl * | getInputControl () const |
Returns the input controller. There is only one instance. | |
io::OSInformator * | getOSInformator () const |
Returns the OS informator. There is only one instance. | |
gui::GUIManager * | getGUIManager () const |
Creates a new GUI manager. | |
audio::SoundDevice * | createSoundDevice (const audio::ESoundDevices Type=audio::SOUNDDEVICE_AUTODETECT) |
Creates a new sound device. | |
void | deleteSoundDevice (audio::SoundDevice *SoundDevice) |
network::NetworkSystem * | createNetworkSystem (const network::ENetworkSystems Type) |
void | deleteNetworkSystem (network::NetworkSystem *NetSys) |
video::CgShaderContext * | createCgShaderContext () |
Creates a Cg shader context. Only one instance of this class can be created. | |
void | deleteCgShaderContext () |
scene::SceneGraph * | createSceneGraph (const scene::ESceneGraphs Type=scene::SCENEGRAPH_SIMPLE) |
void | deleteSceneGraph (scene::SceneGraph *SceneGraph) |
template<class T > | |
T * | createSceneGraph () |
Creates an individual scene graph object. | |
scene::CollisionGraph * | createCollisionGraph () |
Creates a new collision graph for collision detection and resolving. | |
void | deleteCollisionGraph (scene::CollisionGraph *CollGraph) |
video::RenderContext * | createRenderContext (void *ParentWindow, const dim::size2di &Resolution, const io::stringc &Title="") |
void | deleteRenderContext (video::RenderContext *Context) |
virtual bool | updateDeviceSettings (const dim::size2di &Resolution, s32 ColorDepth=DEF_COLORDEPTH, bool isFullscreen=false, const SDeviceFlags &Flags=SDeviceFlags(), void *ParentWindow=0) |
virtual bool | updateEvents ()=0 |
void | updateBaseEvents () |
Updates only the base events but not the window events. Use this only if you update the window events by yourself! | |
void | setActiveSceneGraph (scene::SceneGraph *ActiveSceneGraph) |
scene::SceneGraph * | getActiveSceneGraph () const |
virtual void | setFrameRate (u32 FrameRate=DEF_FRAMERATE) |
virtual io::stringc | getVersion () const |
virtual void | beep (u32 Milliseconds=100, u32 Frequency=1000) |
Occurs a beep sound with the specified frequency and for the spcified duration. | |
virtual void | manipulateScreenSize (const dim::size2di &ScreenSize) |
virtual s32 | registerFontResource (const io::stringc &Filename) |
virtual void | unregisterFontResource (const io::stringc &Filename) |
Unregisters the specifies font resource file. | |
dim::size2di | getResolution () const |
Returns the screen resolution. Only the screen from the main context is taken into account. | |
SDeviceFlags | getFlags () const |
Returns the device flags. | |
const std::list < network::NetworkSystem * > & | getNetworkSystemList () const |
Protected Member Functions | |
SoftPixelDevice (const video::ERenderSystems RendererType, const dim::size2di &Resolution, s32 ColorDepth, bool isFullscreen, const SDeviceFlags &Flags) | |
virtual void | autoDetectRenderSystem () |
virtual bool | checkRenderSystem (const video::ERenderSystems Type) const |
virtual bool | createRenderSystemAndContext () |
virtual video::RenderSystem * | allocRenderSystem () |
virtual video::RenderContext * | allocRenderContext () |
virtual void | deleteResourceDevices () |
virtual void | releaseGraphicsContext () |
virtual void | printConsoleHeader () |
Protected Attributes | |
video::ERenderSystems | RendererType_ |
dim::size2di | Resolution_ |
s32 | ColorDepth_ |
bool | isFullscreen_ |
SDeviceFlags | Flags_ |
u32 | FrameRate_ |
scene::SceneGraph * | DefaultSceneManager_ |
std::list< video::RenderContext * > | RenderContextList_ |
std::list< audio::SoundDevice * > | SoundDeviceList_ |
std::list< scene::SceneGraph * > | SceneGraphList_ |
std::list < scene::CollisionGraph * > | CollGraphList_ |
std::list < network::NetworkSystem * > | NetworkSystemList_ |
SoftPixel Engine device interface.
sp::SoftPixelDevice::~SoftPixelDevice | ( | ) | [virtual] |
sp::SoftPixelDevice::SoftPixelDevice | ( | const video::ERenderSystems | RendererType, | |
const dim::size2di & | Resolution, | |||
s32 | ColorDepth, | |||
bool | isFullscreen, | |||
const SDeviceFlags & | Flags | |||
) | [protected] |
video::RenderContext * sp::SoftPixelDevice::allocRenderContext | ( | ) | [protected, virtual] |
video::RenderSystem * sp::SoftPixelDevice::allocRenderSystem | ( | ) | [protected, virtual] |
void sp::SoftPixelDevice::autoDetectRenderSystem | ( | ) | [protected, virtual] |
Occurs a beep sound with the specified frequency and for the spcified duration.
Reimplemented in sp::SoftPixelDeviceLinux, and sp::SoftPixelDeviceWin32.
bool sp::SoftPixelDevice::checkRenderSystem | ( | const video::ERenderSystems | Type | ) | const [protected, virtual] |
video::CgShaderContext * sp::SoftPixelDevice::createCgShaderContext | ( | ) |
Creates a Cg shader context. Only one instance of this class can be created.
scene::CollisionGraph * sp::SoftPixelDevice::createCollisionGraph | ( | ) |
Creates a new collision graph for collision detection and resolving.
network::NetworkSystem * sp::SoftPixelDevice::createNetworkSystem | ( | const network::ENetworkSystems | Type | ) |
Creates a network system.
video::RenderContext * sp::SoftPixelDevice::createRenderContext | ( | void * | ParentWindow, | |
const dim::size2di & | Resolution, | |||
const io::stringc & | Title = "" | |||
) |
Creates a new render context which will autimatically share the resources with the main render context which can be get by "getRenderContext".
ParentWindow,: | Specifies a pointer to the parent window (e.g. HWND for Windows) which is to be used for the new render context. If this pointer is null a default graphics window will be created. | |
Resolution,: | Specifies the graphics resolution and window size if no parent window is specified. | |
Title,: | Specifies the title for the graphics window if no parent window is specified. |
bool sp::SoftPixelDevice::createRenderSystemAndContext | ( | ) | [protected, virtual] |
scene::SceneGraph * sp::SoftPixelDevice::createSceneGraph | ( | const scene::ESceneGraphs | Type = scene::SCENEGRAPH_SIMPLE |
) |
Creates a new scene graph. You can also create several scene graphs (using "new" and "delete" manual).
Type,: | Type of the scene graph. Since version 2.1 you can choose the type of the scene graph. By default the straight forwared scene graph is used where each object will be passed through. e.g. for extremely large (or rather expansive) scenes you can use a tree hierarchy (e.g. scene::SCENEGRAPH_TREE). |
T* sp::SoftPixelDevice::createSceneGraph | ( | ) | [inline] |
Creates an individual scene graph object.
audio::SoundDevice * sp::SoftPixelDevice::createSoundDevice | ( | const audio::ESoundDevices | Type = audio::SOUNDDEVICE_AUTODETECT |
) |
Creates a new sound device.
void sp::SoftPixelDevice::deleteCgShaderContext | ( | ) |
void sp::SoftPixelDevice::deleteCollisionGraph | ( | scene::CollisionGraph * | CollGraph | ) |
void sp::SoftPixelDevice::deleteNetworkSystem | ( | network::NetworkSystem * | NetSys | ) |
void sp::SoftPixelDevice::deleteRenderContext | ( | video::RenderContext * | Context | ) |
Deletes the specified render context.
void sp::SoftPixelDevice::deleteResourceDevices | ( | ) | [protected, virtual] |
void sp::SoftPixelDevice::deleteSceneGraph | ( | scene::SceneGraph * | SceneGraph | ) |
void sp::SoftPixelDevice::deleteSoundDevice | ( | audio::SoundDevice * | SoundDevice | ) |
scene::SceneGraph * sp::SoftPixelDevice::getActiveSceneGraph | ( | ) | const |
SDeviceFlags sp::SoftPixelDevice::getFlags | ( | ) | const [inline] |
Returns the device flags.
gui::GUIManager * sp::SoftPixelDevice::getGUIManager | ( | ) | const |
Creates a new GUI manager.
io::InputControl * sp::SoftPixelDevice::getInputControl | ( | ) | const |
Returns the input controller. There is only one instance.
const std::list<network::NetworkSystem*>& sp::SoftPixelDevice::getNetworkSystemList | ( | ) | const [inline] |
io::OSInformator * sp::SoftPixelDevice::getOSInformator | ( | ) | const |
Returns the OS informator. There is only one instance.
video::RenderContext * sp::SoftPixelDevice::getRenderContext | ( | ) | const |
Returns the main render context. There is at least one instance.
video::RenderSystem * sp::SoftPixelDevice::getRenderSystem | ( | ) | const |
Returns the render system. There is only one instance.
dim::size2di sp::SoftPixelDevice::getResolution | ( | ) | const [inline] |
Returns the screen resolution. Only the screen from the main context is taken into account.
scene::SceneManager * sp::SoftPixelDevice::getSceneManager | ( | ) | const |
Returns the scene manager. There is only one instance.
io::stringc sp::SoftPixelDevice::getVersion | ( | ) | const [virtual] |
void sp::SoftPixelDevice::manipulateScreenSize | ( | const dim::size2di & | ScreenSize | ) | [virtual] |
Manipulates the internal screen size (or rather resolution) values.
void sp::SoftPixelDevice::printConsoleHeader | ( | ) | [protected, virtual] |
s32 sp::SoftPixelDevice::registerFontResource | ( | const io::stringc & | Filename | ) | [virtual] |
Registers a new font resource file. This is currently only supported on MS/Windows.
Filename,: | Specifies the filename for the font resource which is to be registerd. On MS/Windows this should be a TTF (TrueType Font) file. |
Reimplemented in sp::SoftPixelDeviceWin32.
void sp::SoftPixelDevice::releaseGraphicsContext | ( | ) | [protected, virtual] |
void sp::SoftPixelDevice::setActiveSceneGraph | ( | scene::SceneGraph * | ActiveSceneGraph | ) |
Sets the active scene graph. Functions like "draw3DLine" are using the active scene manager.
ActiveSceneGraph,: | SceneGraph which is to be set to the new active one. If this parameter is 0 the default SceneGraph is used. |
void sp::SoftPixelDevice::setFrameRate | ( | u32 | FrameRate = DEF_FRAMERATE |
) | [virtual] |
Sets the maximal frame rate. Use this feature if vertical-synchronisation does not effect the program speed and your application runs too fast (in the case of 500 FPS and higher).
FrameRate,: | Count of frames per second. If you want to disable maxial frame rate to let the program run with full speed set it to 0. |
void sp::SoftPixelDevice::unregisterFontResource | ( | const io::stringc & | Filename | ) | [virtual] |
Unregisters the specifies font resource file.
Reimplemented in sp::SoftPixelDeviceWin32.
void sp::SoftPixelDevice::updateBaseEvents | ( | ) |
Updates only the base events but not the window events. Use this only if you update the window events by yourself!
bool sp::SoftPixelDevice::updateDeviceSettings | ( | const dim::size2di & | Resolution, | |
s32 | ColorDepth = DEF_COLORDEPTH , |
|||
bool | isFullscreen = false , |
|||
const SDeviceFlags & | Flags = SDeviceFlags() , |
|||
void * | ParentWindow = 0 | |||
) | [virtual] |
Updates the device settings. This recreated the main window, device- and render context. If any settings has changed all resources will automatically updated. If you want to change the render system you need to delete the device, create a new one and load all resources again. This feature is only supported on desktop platforms like Windows and Linux.
Resolution,: | Specifies the new device resolution. | |
ColorDepth,: | Specifies the new color depth (in bits). By default 32. | |
isFullscreen,: | Specifies whether the new device is to be in window mode or fullscreen. | |
Flags,: | Specifies the new devices flags. | |
ParentWindow,: | Specifies the new parent window. On Windows this must be a pointer to a HWND instance. |
Reimplemented in sp::SoftPixelDeviceWin32.
virtual bool sp::SoftPixelDevice::updateEvents | ( | ) | [pure virtual] |
Updates all window events. This functions needs to be called every frame. Typically in the main "while" loop. It will update the input states (keyboard, mouse etc.), window callback function on a MS/Windows platform, and some other global state functionality..
Implemented in sp::SoftPixelDeviceAndroid, sp::SoftPixelDeviceIOS, sp::SoftPixelDeviceLinux, sp::SoftPixelDeviceMacOSX, and sp::SoftPixelDeviceWin32.
std::list<scene::CollisionGraph*> sp::SoftPixelDevice::CollGraphList_ [protected] |
s32 sp::SoftPixelDevice::ColorDepth_ [protected] |
SDeviceFlags sp::SoftPixelDevice::Flags_ [protected] |
u32 sp::SoftPixelDevice::FrameRate_ [protected] |
bool sp::SoftPixelDevice::isFullscreen_ [protected] |
std::list<network::NetworkSystem*> sp::SoftPixelDevice::NetworkSystemList_ [protected] |
std::list<video::RenderContext*> sp::SoftPixelDevice::RenderContextList_ [protected] |
dim::size2di sp::SoftPixelDevice::Resolution_ [protected] |
std::list<scene::SceneGraph*> sp::SoftPixelDevice::SceneGraphList_ [protected] |
std::list<audio::SoundDevice*> sp::SoftPixelDevice::SoundDeviceList_ [protected] |