Ocean
|
This class is the base class for all rendering engines like. More...
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 GraphicAPI > | CreateCallback |
Definition of a callback function used to create a registered engine. More... | |
typedef std::vector< FramebufferRef > | Framebuffers |
Definition of a vector holding framebuffer references. More... | |
Public Member Functions | |
virtual const Factory & | factory () 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... | |
Lock & | lock () const |
Retruns the lock object of this engine. More... | |
Lock & | renderLock () |
Returns the render lock of this engine. More... | |
Protected Types | |
typedef std::vector< ObjectId > | ObjectIds |
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 Framebuffer * | internalCreateFramebuffer (const Framebuffer::FramebufferType type, const Framebuffer::FramebufferConfig &config)=0 |
Returns a framebuffer reference of a just created framebuffer object. More... | |
Engine & | operator= (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 > |
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.
typedef Callback<Engine*, const GraphicAPI> Ocean::Rendering::Engine::CreateCallback |
Definition of a callback function used to create a registered engine.
typedef std::vector<FramebufferRef> Ocean::Rendering::Engine::Framebuffers |
Definition of a vector holding framebuffer references.
|
protected |
Definition of a vector holding framebuffer ids.
enum Ocean::Rendering::Engine::GraphicAPI : uint32_t |
|
protecteddelete |
Disabled copy constructor.
engine | Object which would be copied |
|
protected |
Creates a new render engine.
graphicAPI | Supported graphic APIs |
|
protectedvirtual |
Destructs a render engine.
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.
type | Type of the framebuffer to be created |
config | The configuration of the framebuffer to create |
|
pure virtual |
Returns the name of this engine.
Implemented in Ocean::Rendering::GlobalIllumination::GIEngine, and Ocean::Rendering::GLESceneGraph::GLESEngine.
|
virtual |
Returns the extensions supported by the first created framebuffer.
|
pure virtual |
Returns the factory of this render engine.
Implemented in Ocean::Rendering::GlobalIllumination::GIEngine, and Ocean::Rendering::GLESceneGraph::GLESEngine.
Framebuffers Ocean::Rendering::Engine::framebuffers | ( | ) | const |
Returns all created and valid framebuffer.
|
inline |
Returns the selected graphic API.
|
virtual |
Returns whether the first framebuffer created by this engine supports a specific extension.
extension | Extension to check |
|
protectedpure virtual |
Returns a framebuffer reference of a just created framebuffer object.
type | Type of the framebuffer to be created |
config | The configuration of the framebuffer to create |
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.
|
inline |
Retruns the lock object of this engine.
Beware: Use this lock with caution.
Returns an object by a given object id belonging to this engine.
If the object does not exist an empty reference is returned.
objectId | Id of the object to return |
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.
name | The name of the object to return |
ObjectRefs Ocean::Rendering::Engine::objects | ( | const std::string & | name | ) | const |
Returns all objects having a specified name and belonging to this engine.
name | The name of the objects to return |
Disabled copy operator.
engine | Object which would be copied |
|
protected |
Registers a new dynamic object.
object | Dynamic object to register |
|
staticprotected |
Registers an engine at the manager.
engineName | Name of the engine to register |
callback | Engine create callback to create an engine object on demand |
graphicAPI | Graphic API supported by the given engine |
priority | Priority of this engine, if a default engine is requested the engine with higher priority will be retuned |
|
inline |
Returns the render lock of this engine.
The lock should be locked whenever a frame rendering is invoked related to this engine.
|
inline |
Returns the graphic APIs supported by this engine.
|
inline |
Returns the recent timestamp of the engine.
The engine's timestamp controls e.g., animations or video textures.
|
protected |
Unregisters a dynamic object.
object | Dynamic object to unregister |
|
staticprotected |
Unregisters an engine at the manager.
engine | Name of the engine to unregister |
|
virtual |
Updates dynamic objects in the engine.
timestamp | The current timestamp to be used to update the dynamic objects, e.g., to control animations or video textures, must be valid |
|
friend |
|
friend |
|
friend |
|
protected |
Vector holding ids of all registered dynamic objects for this engine.
|
protected |
Vector holding all ids of created framebuffers.
|
protected |
Selected graphic API.
|
protected |
Dynamic object lock.
|
protected |
Render lock.
|
protected |
Supported graphic API.
|
protected |
The recent timestamp of the engine, to control e.g., animations or video textures.