Ogre2 render engine class. A singleton class that manages the underlying ogre2 render engine, loads its plugins, and creates resources needed for the engine to run. More...

#include <Ogre2RenderEngine.hh>

Public Member Functions

virtual ~Ogre2RenderEngine ()
 Destructor. More...
 
void AddResourcePath (const std::string &_uri) override
 Add path to resource in ogre2's resource manager. More...
 
virtual NativeWindowPtr CreateNativeWindow (const std::string &_winHandle, const uint32_t _width, const uint32_t _height, const double _ratio) override
 Creates a basic native window. Note: This is useful when you need a basic single window with both great performance and compatibility. But e.g. creating more than one window may have additional complexities depending on OS and RenderSystem. More...
 
std::string CreateRenderWindow (const std::string &_handle, const unsigned int _width, const unsigned int _height, const double _ratio, const unsigned int _antiAliasing)
 Create a render window. More...
 
virtual void Destroy () override
 Destroys all scenes created by render-engine and releases all loaded resources. This should be called when the given render-engine will no longer be used during runtime. More...
 
std::vector< unsigned int > FSAALevels () const
 Get a list of all supported FSAA levels for this render system. More...
 
virtual rendering::GraphicsAPI GraphicsAPI () const override
 Returns the GraphicsAPI currently in use. More...
 
Ogre2GzHlmsSphericalClipMinDistance & HlmsCustomizations ()
 Deprecated. Use SphericalClipMinDistance instead. More...
 
Ogre::HlmsPbsTerraShadows * HlmsPbsTerraShadows () const
 
virtual bool IsEnabled () const override
 Determines if the render-engine can be used. Despite loading and initializing the render-engine, it may not be possible to use due to hardware capabilities of the runtime system. More...
 
virtual std::string Name () const override
 Get name of the render-engine. More...
 
virtual Ogre::Root * OgreRoot () const
 Get the ogre2 root object. More...
 
Ogre::Window * OgreWindow () const
 return the ogre window More...
 
Ogre::v1::OverlaySystem * OverlaySystem () const
 
void SetGzOgreRenderingMode (GzOgreRenderingMode renderingMode)
 
void SetIgnOgreRenderingMode (GzOgreRenderingMode renderingMode)
 
Ogre2GzHlmsSphericalClipMinDistance & SphericalClipMinDistance ()
 Retrieves Hlms customizations for tweaking them. More...
 
Ogre::CompositorWorkspaceListener * TerraWorkspaceListener () const
 
- Public Member Functions inherited from BaseRenderEngine
virtual ~BaseRenderEngine ()
 
virtual ScenePtr CreateScene (const std::string &_name) override
 Create a new scene with the given name. The given name should be unique across all scenes managed by this render-engine. If a duplicate name is given, NULL will be returned. An unique ID will automatically be assigned to the created scene. More...
 
virtual ScenePtr CreateScene (unsigned int _id, const std::string &_name) override
 Create a new scene with the given ID. The given ID should be unique across all scenes managed by this render-engine. If a duplicate ID is given, NULL will be returned. An unique name will automatically be assigned to the created scene. More...
 
virtual void DestroyScene (ScenePtr _scene) override
 Destroy the given scene. If the given scene is not managed by this render-engine, no work will be done. More...
 
virtual void DestroySceneById (unsigned int _id) override
 Destroy the scene with the given ID. If no scenes exist with the given ID, no work will be done. More...
 
virtual void DestroySceneByIndex (unsigned int _index) override
 Destroy the scene at the given index. If no scenes exist at the given index, no work will be done. More...
 
virtual void DestroySceneByName (const std::string &_name) override
 Destroy the scene with the given name. If no scenes exist with the given name, no work will be done. More...
 
virtual void DestroyScenes () override
 Destroy all scenes managed by this render-engine. More...
 
virtual bool Fini () override
 
virtual bool HasScene (ConstScenePtr _scene) const override
 Determine if the given scene is actively managed by this render-engine. More...
 
virtual bool HasSceneId (unsigned int _id) const override
 Determine if this render-engine manages a scene with the given ID. More...
 
virtual bool HasSceneName (const std::string &_name) const override
 Determine if this render-engine manages a scene with the given name. More...
 
virtual bool Headless () const override
 Get headless mode. More...
 
virtual bool Init () override
 Initialize the render-engine. This should be called immediately after a successful call to Load. More...
 
virtual bool IsInitialized () const override
 Determines if the render-engine has been initialized. More...
 
virtual bool IsLoaded () const override
 Determines if the render-engine has been loaded. More...
 
virtual bool Load (const std::map< std::string, std::string > &_params={}) override
 Load any necessary resources to set up render-engine. This should called before any other function. More...
 
virtual RenderPassSystemPtr RenderPassSystem () const override
 Get the render pass system for this engine. More...
 
virtual ScenePtr SceneById (unsigned int _id) const override
 Get the scene with the given ID. If no scenes exist with the given ID, NULL will be returned. More...
 
virtual ScenePtr SceneByIndex (unsigned int _index) const override
 Get the scene at the given index. If no scenes exist at the given index, NULL will be returned. More...
 
virtual ScenePtr SceneByName (const std::string &_name) const override
 Get the scene with the given name. If no scenes exist with the given name, NULL will be returned. More...
 
virtual unsigned int SceneCount () const override
 Get the number of scenes actively managed by this render-engine. More...
 
virtual void SetHeadless (bool _headless) override
 Set headless mode Only available in OGRE 2.2, which makes use of EGL. More...
 
- Public Member Functions inherited from RenderEngine
virtual ~RenderEngine ()
 Destructor. More...
 

Static Public Member Functions

static Ogre2RenderEngineInstance ()
 Get a pointer to the render engine. More...
 

Protected Member Functions

virtual ScenePtr CreateSceneImpl (unsigned int _id, const std::string &_name) override
 Create a scene. More...
 
virtual bool InitImpl () override
 Initialize the render engine. More...
 
virtual bool LoadImpl (const std::map< std::string, std::string > &_params) override
 Engine implementation of Load function. More...
 
virtual SceneStorePtr Scenes () const override
 Get a pointer to the list of scenes managed by the render engine. More...
 
- Protected Member Functions inherited from BaseRenderEngine
 BaseRenderEngine ()
 
virtual unsigned int NextSceneId ()
 
virtual void PrepareScene (ScenePtr _scene)
 

Additional Inherited Members

- Protected Attributes inherited from BaseRenderEngine
bool initialized = false
 
bool isHeadless = false
 
bool loaded = false
 
unsigned int nextSceneId
 
RenderPassSystemPtr renderPassSystem
 Render pass system for this render engine. More...
 
std::vector< std::stringresourcePaths
 a list of paths that render engines use to locate their resources More...
 
std::string winID = ""
 ID from a external window. More...
 

Detailed Description

Ogre2 render engine class. A singleton class that manages the underlying ogre2 render engine, loads its plugins, and creates resources needed for the engine to run.

Constructor & Destructor Documentation

🔗~Ogre2RenderEngine()

virtual ~Ogre2RenderEngine ( )
virtual

Destructor.

Member Function Documentation

🔗AddResourcePath()

void AddResourcePath ( const std::string _uri)
overridevirtual

Add path to resource in ogre2's resource manager.

Parameters
[in]_uriResource path in the form of an uri

Reimplemented from BaseRenderEngine.

🔗CreateNativeWindow()

virtual NativeWindowPtr CreateNativeWindow ( const std::string _winHandle,
const uint32_t  _width,
const uint32_t  _height,
const double  _ratio 
)
overridevirtual

Creates a basic native window. Note: This is useful when you need a basic single window with both great performance and compatibility. But e.g. creating more than one window may have additional complexities depending on OS and RenderSystem.

Parameters
[in]_winHandleSee samples on what to fill in here
[in]_widthStarting width
[in]_heightStarting height
[in]_ratioDevice pixel ratio (typically needed for retina displays)
Returns
NativeWindow. It may be nullptr if the underlying engine hasn't implemented one

Reimplemented from BaseRenderEngine.

🔗CreateRenderWindow()

std::string CreateRenderWindow ( const std::string _handle,
const unsigned int  _width,
const unsigned int  _height,
const double  _ratio,
const unsigned int  _antiAliasing 
)

Create a render window.

Parameters
[in]_handleHandle of native window which the render window will attach
[in]_widthWidth of render window
[in]_heightHeight of render window
[in]_ratioDevice pixel ratio (typically needed for retina displays)
[in]_antiAliasingAnti-aliasing level

🔗CreateSceneImpl()

virtual ScenePtr CreateSceneImpl ( unsigned int  _id,
const std::string _name 
)
overrideprotectedvirtual

Create a scene.

Parameters
[in]_idUnique scene Id
[in]_nameName of scene

Implements BaseRenderEngine.

🔗Destroy()

virtual void Destroy ( )
overridevirtual

Destroys all scenes created by render-engine and releases all loaded resources. This should be called when the given render-engine will no longer be used during runtime.

Reimplemented from BaseRenderEngine.

🔗FSAALevels()

std::vector<unsigned int> FSAALevels ( ) const

Get a list of all supported FSAA levels for this render system.

Returns
a list of FSAA levels

🔗GraphicsAPI()

virtual rendering::GraphicsAPI GraphicsAPI ( ) const
overridevirtual

Returns the GraphicsAPI currently in use.

Returns
GraphicsAPI currently in use

Reimplemented from BaseRenderEngine.

🔗HlmsCustomizations()

Ogre2GzHlmsSphericalClipMinDistance& HlmsCustomizations ( )

Deprecated. Use SphericalClipMinDistance instead.

🔗HlmsPbsTerraShadows()

Ogre::HlmsPbsTerraShadows* HlmsPbsTerraShadows ( ) const

🔗InitImpl()

virtual bool InitImpl ( )
overrideprotectedvirtual

Initialize the render engine.

Returns
True if the operation is successful

Implements BaseRenderEngine.

🔗Instance()

static Ogre2RenderEngine* Instance ( )
static

Get a pointer to the render engine.

Returns
a pointer to the render engine

🔗IsEnabled()

virtual bool IsEnabled ( ) const
overridevirtual

Determines if the render-engine can be used. Despite loading and initializing the render-engine, it may not be possible to use due to hardware capabilities of the runtime system.

Returns
True if the render-engine can be used

Reimplemented from BaseRenderEngine.

🔗LoadImpl()

virtual bool LoadImpl ( const std::map< std::string, std::string > &  _params)
overrideprotectedvirtual

Engine implementation of Load function.

Parameters
[in]_paramsParameters to be passed to the render engine.

Implements BaseRenderEngine.

🔗Name()

virtual std::string Name ( ) const
overridevirtual

Get name of the render-engine.

Returns
The render-engine name

Implements RenderEngine.

🔗OgreRoot()

virtual Ogre::Root* OgreRoot ( ) const
virtual

Get the ogre2 root object.

Returns
ogre2 root object

🔗OgreWindow()

Ogre::Window* OgreWindow ( ) const

return the ogre window

🔗OverlaySystem()

Ogre::v1::OverlaySystem* OverlaySystem ( ) const

🔗Scenes()

virtual SceneStorePtr Scenes ( ) const
overrideprotectedvirtual

Get a pointer to the list of scenes managed by the render engine.

Returns
list of scenes

Implements BaseRenderEngine.

🔗SetGzOgreRenderingMode()

void SetGzOgreRenderingMode ( GzOgreRenderingMode  renderingMode)

🔗SetIgnOgreRenderingMode()

void SetIgnOgreRenderingMode ( GzOgreRenderingMode  renderingMode)
inline

🔗SphericalClipMinDistance()

Ogre2GzHlmsSphericalClipMinDistance& SphericalClipMinDistance ( )

Retrieves Hlms customizations for tweaking them.

Returns
Ogre HLMS customizations

🔗TerraWorkspaceListener()

Ogre::CompositorWorkspaceListener* TerraWorkspaceListener ( ) const

The documentation for this class was generated from the following file: