Ocean
Ocean::Rendering::Engine Class Referenceabstract

This class is the base class for all rendering engines like. More...

Inheritance diagram for Ocean::Rendering::Engine:

Public Types

enum  GraphicAPI : uint32_t {
  API_DEFAULT = 0u , API_OPENGL = 1u , API_OPENGLES = 2u , API_DIRECTX = 4u ,
  API_RAYTRACER = 8u
}
 Definition of different graphic APIs. More...
 
typedef Callback< Engine *, const GraphicAPICreateCallback
 Definition of a callback function used to create a registered engine. More...
 
typedef std::vector< FramebufferRefFramebuffers
 Definition of a vector holding framebuffer references. More...
 

Public Member Functions

virtual const Factoryfactory () const =0
 Returns the factory of this render engine. More...
 
Framebuffers framebuffers () const
 Returns all created and valid framebuffer. More...
 
FramebufferRef createFramebuffer (const Framebuffer::FramebufferType type=Framebuffer::FRAMEBUFFER_WINDOW, const Framebuffer::FramebufferConfig &config={})
 Returns a new framebuffer of this render engine. More...
 
virtual const std::string & engineName () const =0
 Returns the name of this engine. More...
 
GraphicAPI graphicAPI () const
 Returns the selected graphic API. More...
 
GraphicAPI supportedAPIs () const
 Returns the graphic APIs supported by this engine. More...
 
virtual void update (const Timestamp timestamp)
 Updates dynamic objects in the engine. More...
 
ObjectRef object (const ObjectId objectId) const
 Returns an object by a given object id belonging to this engine. More...
 
ObjectRef object (const std::string &name) const
 Returns the first object having a specified name and belonging to this engine. More...
 
ObjectRefs objects (const std::string &name) const
 Returns all objects having a specified name and belonging to this engine. More...
 
virtual std::string extensions () const
 Returns the extensions supported by the first created framebuffer. More...
 
virtual bool hasExtension (const std::string &extension) const
 Returns whether the first framebuffer created by this engine supports a specific extension. More...
 
Timestamp timestamp () const
 Returns the recent timestamp of the engine. More...
 
Locklock () const
 Retruns the lock object of this engine. More...
 
LockrenderLock ()
 Returns the render lock of this engine. More...
 

Protected Types

typedef std::vector< ObjectIdObjectIds
 Definition of a vector holding framebuffer ids. More...
 

Protected Member Functions

 Engine (const Engine &engine)=delete
 Disabled copy constructor. More...
 
 Engine (const GraphicAPI graphicAPI)
 Creates a new render engine. More...
 
virtual ~Engine ()
 Destructs a render engine. More...
 
void registerDynamicObject (DynamicObject *object)
 Registers a new dynamic object. More...
 
void unregisterDynamicObject (DynamicObject *object)
 Unregisters a dynamic object. More...
 
virtual FramebufferinternalCreateFramebuffer (const Framebuffer::FramebufferType type, const Framebuffer::FramebufferConfig &config)=0
 Returns a framebuffer reference of a just created framebuffer object. More...
 
Engineoperator= (const Engine &engine)=delete
 Disabled copy operator. More...
 

Static Protected Member Functions

static void registerEngine (const std::string &engineName, const CreateCallback &callback, const GraphicAPI graphicAPI, const unsigned int priority)
 Registers an engine at the manager. More...
 
static bool unregisterEngine (const std::string &engine)
 Unregisters an engine at the manager. More...
 

Protected Attributes

GraphicAPI graphicAPI_
 Selected graphic API. More...
 
const GraphicAPI supportedGraphicAPIs_
 Supported graphic API. More...
 
ObjectIds dynamicObjects_
 Vector holding ids of all registered dynamic objects for this engine. More...
 
Timestamp timestamp_
 The recent timestamp of the engine, to control e.g., animations or video textures. More...
 
ObjectIds framebufferIds_
 Vector holding all ids of created framebuffers. More...
 
Lock lock_
 Engine lock. More...
 
Lock renderLock_
 Render lock. More...
 
Lock objectLock_
 Dynamic object lock. More...
 

Friends

class DynamicObject
 
class Manager
 
class Ocean::ObjectRef< Engine >
 

Detailed Description

This class is the base class for all rendering engines like.


The main task of this class is to provide a framebuffer and a factory to create and render geometry nodes.
The factory is able to create all supported rendering nodes and objects.
The framebuffer holds the scene, the view and the resulting frame.
Beware: Do not use the derivated instances of this object.

The manager holds and manages all engine instances for the registered rendering plugins like e.g. Nvidia SceniX or the GLESceneGraph.
Therefore, receive an engine instance for a specific render engine from the manager only.
Afterwards, the engine must be initialized before usage.

See also
Factory, Framebuffer, Manager

Member Typedef Documentation

◆ CreateCallback

Definition of a callback function used to create a registered engine.

◆ Framebuffers

Definition of a vector holding framebuffer references.

◆ ObjectIds

typedef std::vector<ObjectId> Ocean::Rendering::Engine::ObjectIds
protected

Definition of a vector holding framebuffer ids.

Member Enumeration Documentation

◆ GraphicAPI

Definition of different graphic APIs.

Enumerator
API_DEFAULT 

Invalid graphic api id.

API_OPENGL 

OpenGL graphic api id.

API_OPENGLES 

OpenGL ES graphic api id.

API_DIRECTX 

DirectX graphic api id.

API_RAYTRACER 

Raytracer graphic api id.

Constructor & Destructor Documentation

◆ Engine() [1/2]

Ocean::Rendering::Engine::Engine ( const Engine engine)
protecteddelete

Disabled copy constructor.

Parameters
engineObject which would be copied

◆ Engine() [2/2]

Ocean::Rendering::Engine::Engine ( const GraphicAPI  graphicAPI)
protected

Creates a new render engine.

Parameters
graphicAPISupported graphic APIs

◆ ~Engine()

virtual Ocean::Rendering::Engine::~Engine ( )
protectedvirtual

Destructs a render engine.

Member Function Documentation

◆ createFramebuffer()

FramebufferRef Ocean::Rendering::Engine::createFramebuffer ( const Framebuffer::FramebufferType  type = Framebuffer::FRAMEBUFFER_WINDOW,
const Framebuffer::FramebufferConfig config = {} 
)

Returns a new framebuffer of this render engine.

This function return the framebuffer created by the internal create framebuffer function.

Parameters
typeType of the framebuffer to be created
configThe configuration of the framebuffer to create
See also
Framebuffer, internalCreateFramebuffer().
Returns
New framebuffer of this render engine

◆ engineName()

virtual const std::string& Ocean::Rendering::Engine::engineName ( ) const
pure virtual

Returns the name of this engine.

Returns
Engine name

Implemented in Ocean::Rendering::GlobalIllumination::GIEngine, and Ocean::Rendering::GLESceneGraph::GLESEngine.

◆ extensions()

virtual std::string Ocean::Rendering::Engine::extensions ( ) const
virtual

Returns the extensions supported by the first created framebuffer.

Returns
Supported extensions separated by a blank

◆ factory()

virtual const Factory& Ocean::Rendering::Engine::factory ( ) const
pure virtual

Returns the factory of this render engine.

Returns
Factory of render engine

Implemented in Ocean::Rendering::GlobalIllumination::GIEngine, and Ocean::Rendering::GLESceneGraph::GLESEngine.

◆ framebuffers()

Framebuffers Ocean::Rendering::Engine::framebuffers ( ) const

Returns all created and valid framebuffer.

Returns
Framebuffer references

◆ graphicAPI()

Engine::GraphicAPI Ocean::Rendering::Engine::graphicAPI ( ) const
inline

Returns the selected graphic API.

Returns
Graphic API

◆ hasExtension()

virtual bool Ocean::Rendering::Engine::hasExtension ( const std::string &  extension) const
virtual

Returns whether the first framebuffer created by this engine supports a specific extension.

Parameters
extensionExtension to check
Returns
True, if the extension is supported

◆ internalCreateFramebuffer()

virtual Framebuffer* Ocean::Rendering::Engine::internalCreateFramebuffer ( const Framebuffer::FramebufferType  type,
const Framebuffer::FramebufferConfig config 
)
protectedpure virtual

Returns a framebuffer reference of a just created framebuffer object.

Parameters
typeType of the framebuffer to be created
configThe configuration of the framebuffer to create
Returns
New framebuffer to create a reference from

Implemented in Ocean::Rendering::GlobalIllumination::GIEngine, Ocean::Rendering::GLESceneGraph::Windows::GLESEngineWindows, Ocean::Rendering::GLESceneGraph::Quest::GLESEngineQuest, Ocean::Rendering::GLESceneGraph::QT::GLESEngineQT, Ocean::Rendering::GLESceneGraph::Apple::GLESEngineApple, and Ocean::Rendering::GLESceneGraph::Android::GLESEngineAndroid.

◆ lock()

Lock & Ocean::Rendering::Engine::lock ( ) const
inline

Retruns the lock object of this engine.

Beware: Use this lock with caution.

Returns
Engine lock object

◆ object() [1/2]

ObjectRef Ocean::Rendering::Engine::object ( const ObjectId  objectId) const

Returns an object by a given object id belonging to this engine.

If the object does not exist an empty reference is returned.

Parameters
objectIdId of the object to return
Returns
Object reference of the requested object
See also
ObjectRefManager::object().

◆ object() [2/2]

ObjectRef Ocean::Rendering::Engine::object ( const std::string &  name) const

Returns the first object having a specified name and belonging to this engine.

If the object does not exist an empty reference is returned.

Parameters
nameThe name of the object to return
Returns
Object reference of the requested object
See also
ObjectRefManager::object().

◆ objects()

ObjectRefs Ocean::Rendering::Engine::objects ( const std::string &  name) const

Returns all objects having a specified name and belonging to this engine.

Parameters
nameThe name of the objects to return
Returns
Specified objects
See also
ObjectRefManager::objects().

◆ operator=()

Engine& Ocean::Rendering::Engine::operator= ( const Engine engine)
protecteddelete

Disabled copy operator.

Parameters
engineObject which would be copied
Returns
Reference to this object

◆ registerDynamicObject()

void Ocean::Rendering::Engine::registerDynamicObject ( DynamicObject object)
protected

Registers a new dynamic object.

Parameters
objectDynamic object to register

◆ registerEngine()

static void Ocean::Rendering::Engine::registerEngine ( const std::string &  engineName,
const CreateCallback callback,
const GraphicAPI  graphicAPI,
const unsigned int  priority 
)
staticprotected

Registers an engine at the manager.

Parameters
engineNameName of the engine to register
callbackEngine create callback to create an engine object on demand
graphicAPIGraphic API supported by the given engine
priorityPriority of this engine, if a default engine is requested the engine with higher priority will be retuned

◆ renderLock()

Lock & Ocean::Rendering::Engine::renderLock ( )
inline

Returns the render lock of this engine.

The lock should be locked whenever a frame rendering is invoked related to this engine.

Returns
Rendering lock object

◆ supportedAPIs()

Engine::GraphicAPI Ocean::Rendering::Engine::supportedAPIs ( ) const
inline

Returns the graphic APIs supported by this engine.

Returns
Supported graphic APIs.

◆ timestamp()

Timestamp Ocean::Rendering::Engine::timestamp ( ) const
inline

Returns the recent timestamp of the engine.

The engine's timestamp controls e.g., animations or video textures.

Returns
The engine's recent timestamp

◆ unregisterDynamicObject()

void Ocean::Rendering::Engine::unregisterDynamicObject ( DynamicObject object)
protected

Unregisters a dynamic object.

Parameters
objectDynamic object to unregister

◆ unregisterEngine()

static bool Ocean::Rendering::Engine::unregisterEngine ( const std::string &  engine)
staticprotected

Unregisters an engine at the manager.

Parameters
engineName of the engine to unregister
Returns
True, if succeeded

◆ update()

virtual void Ocean::Rendering::Engine::update ( const Timestamp  timestamp)
virtual

Updates dynamic objects in the engine.

Parameters
timestampThe current timestamp to be used to update the dynamic objects, e.g., to control animations or video textures, must be valid

Friends And Related Function Documentation

◆ DynamicObject

friend class DynamicObject
friend

◆ Manager

friend class Manager
friend

◆ Ocean::ObjectRef< Engine >

friend class Ocean::ObjectRef< Engine >
friend

Field Documentation

◆ dynamicObjects_

ObjectIds Ocean::Rendering::Engine::dynamicObjects_
protected

Vector holding ids of all registered dynamic objects for this engine.

◆ framebufferIds_

ObjectIds Ocean::Rendering::Engine::framebufferIds_
protected

Vector holding all ids of created framebuffers.

◆ graphicAPI_

GraphicAPI Ocean::Rendering::Engine::graphicAPI_
protected

Selected graphic API.

◆ lock_

Lock Ocean::Rendering::Engine::lock_
mutableprotected

Engine lock.

◆ objectLock_

Lock Ocean::Rendering::Engine::objectLock_
protected

Dynamic object lock.

◆ renderLock_

Lock Ocean::Rendering::Engine::renderLock_
protected

Render lock.

◆ supportedGraphicAPIs_

const GraphicAPI Ocean::Rendering::Engine::supportedGraphicAPIs_
protected

Supported graphic API.

◆ timestamp_

Timestamp Ocean::Rendering::Engine::timestamp_
protected

The recent timestamp of the engine, to control e.g., animations or video textures.


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