Equalizer  1.12.0
Parallel Rendering Framework
seq::Renderer Class Referenceabstract

A renderer instance. More...

#include <renderer.h>

+ Inheritance diagram for seq::Renderer:
+ Collaboration diagram for seq::Renderer:

Public Member Functions

SEQ_API Renderer (Application &application)
 Construct a new renderer. More...
 
virtual SEQ_API ~Renderer ()
 Destruct this renderer. More...
 
Operations
virtual SEQ_API bool init (co::Object *initData)
 Initialize the renderer. More...
 
virtual SEQ_API bool exit ()
 De-initialize the renderer. More...
 
virtual SEQ_API bool initContext (co::Object *initData)
 Initialize a rendering context. More...
 
virtual SEQ_API bool exitContext ()
 De-initialize a rendering context. More...
 
virtual SEQ_API void clear (co::Object *frameData)
 Clear the frame buffer. More...
 
virtual void draw (co::Object *frameData)=0
 Render the scene. More...
 
SEQ_API void requestRedraw ()
 Request another call to draw(). More...
 
SEQ_API void updateNearFar (const Vector4f &boundingSphere)
 Update the near and far planes to tightly enclose the given sphere. More...
 
SEQ_API void setNearFar (const float nearPlane, const float farPlane)
 Set the near and far planes. More...
 
virtual SEQ_API void applyRenderContext ()
 Apply the current rendering parameters to the rendering context. More...
 
SEQ_API void bindDrawFrameBuffer ()
 Bind the window draw buffer, which can be (multisampled) FBO or window buffer. More...
 
SEQ_API const RenderContextgetRenderContext () const
 
virtual SEQ_API void applyModelMatrix ()
 Apply the current model matrix to the rendering context. More...
 
virtual SEQ_API void applyScreenFrustum ()
 Apply an orthographic frustum for pixel-based 2D operations. More...
 
virtual SEQ_API void applyPerspectiveFrustum ()
 Apply the perspective frustum matrix for the current rendering task. More...
 
virtual SEQ_API bool processEvent (const eq::Event &)
 
Data Access
detail::Renderer * getImpl ()
 
SEQ_API co::Object * getFrameData ()
 
ApplicationgetApplication ()
 
const ApplicationgetApplication () const
 
SEQ_API const ObjectManagergetObjectManager () const
 
SEQ_API ObjectManagergetObjectManager ()
 
virtual SEQ_API ViewDatacreateViewData (View &view)
 Create a new per-view data instance. More...
 
virtual SEQ_API void destroyViewData (ViewData *viewData)
 Delete the given view data. More...
 
SEQ_API const ViewDatagetViewData () const
 
SEQ_API const GLEWContext * glewGetContext () const
 Get the GLEW context for this renderer. More...
 
SEQ_API const Frustumf & getFrustum () const
 
SEQ_API const Matrix4f & getViewMatrix () const
 
SEQ_API const Matrix4f & getModelMatrix () const
 
SEQ_API const PixelViewport & getPixelViewport () const
 
SEQ_API uint32_t getWindowID () const
 
Distributed Object API
virtual SEQ_API co::Object * createObject (const uint32_t type)
 
virtual SEQ_API void destroyObject (co::Object *object, const uint32_t type)
 
SEQ_API co::Object * mapObject (const uint128_t &identifier, co::Object *instance)
 Map and return an object. More...
 
SEQ_API bool unmap (co::Object *object)
 Unmap an object from the object map. More...
 

Detailed Description

A renderer instance.

All calls to one renderer instance are guaranteed to be executed from a single thread.

Definition at line 34 of file renderer.h.

Constructor & Destructor Documentation

SEQ_API seq::Renderer::Renderer ( Application application)
explicit

Construct a new renderer.

Version
1.0
virtual SEQ_API seq::Renderer::~Renderer ( )
virtual

Destruct this renderer.

Version
1.0

Member Function Documentation

virtual SEQ_API void seq::Renderer::applyModelMatrix ( )
virtual

Apply the current model matrix to the rendering context.

This method is not included in applyRenderContext() since ligthing parameters are often applied before positioning the model.

This method is only to be called from clear(), draw() and TBD.

Version
1.0
virtual SEQ_API void seq::Renderer::applyPerspectiveFrustum ( )
virtual

Apply the perspective frustum matrix for the current rendering task.

Version
1.8
virtual SEQ_API void seq::Renderer::applyRenderContext ( )
virtual

Apply the current rendering parameters to the rendering context.

This method sets the draw buffer, color mask, viewport as well as the projection and view matrix.

This method is only to be called from clear(), draw() and TBD.

Version
1.0
virtual SEQ_API void seq::Renderer::applyScreenFrustum ( )
virtual

Apply an orthographic frustum for pixel-based 2D operations.

One unit of the frustum covers one pixel on screen. The frustum is positioned relative to the eq::View.

Version
1.8
SEQ_API void seq::Renderer::bindDrawFrameBuffer ( )

Bind the window draw buffer, which can be (multisampled) FBO or window buffer.

Version
1.12
virtual SEQ_API void seq::Renderer::clear ( co::Object *  frameData)
virtual

Clear the frame buffer.

Parameters
frameDatathe renderer's instance of the object passed to Config::run.
Version
1.0
virtual SEQ_API co::Object* seq::Renderer::createObject ( const uint32_t  type)
virtual
See also
seq::Application::createObject()
virtual SEQ_API ViewData* seq::Renderer::createViewData ( View view)
virtual

Create a new per-view data instance.

Called once for each view used by this renderer. Creates the view instance used by the renderer to retrieve parameters from the application for rendering.

Parameters
viewthe view requesting the view data
Returns
the new view data
Version
1.11
virtual SEQ_API void seq::Renderer::destroyObject ( co::Object *  object,
const uint32_t  type 
)
virtual
See also
seq::Application::destroyObject()
virtual SEQ_API void seq::Renderer::destroyViewData ( ViewData viewData)
virtual

Delete the given view data.

Version
1.0
virtual void seq::Renderer::draw ( co::Object *  frameData)
pure virtual

Render the scene.

Parameters
frameDatathe renderer's instance of the object passed to Config::run.
Version
1.0
virtual SEQ_API bool seq::Renderer::exit ( )
inlinevirtual

De-initialize the renderer.

Called just before the last context will be destroyed after the last call to exitContext().

Returns
true on success, false otherwise.
Version
1.0

Definition at line 68 of file renderer.h.

virtual SEQ_API bool seq::Renderer::exitContext ( )
virtual

De-initialize a rendering context.

Called just before the context will be destroyed.

Returns
true on success, false otherwise.
Version
1.0
Application& seq::Renderer::getApplication ( )
inline
Returns
the application instance for this renderer.
Version
1.0

Definition at line 200 of file renderer.h.

const Application& seq::Renderer::getApplication ( ) const
inline
Returns
the application instance for this renderer.
Version
1.0

Definition at line 203 of file renderer.h.

SEQ_API co::Object* seq::Renderer::getFrameData ( )
Returns
A frame-synchronous instance of the data passed to Application::run().
Version
1.8
SEQ_API const Frustumf& seq::Renderer::getFrustum ( ) const
Returns
the current view frustum.
Version
1.0
SEQ_API const Matrix4f& seq::Renderer::getModelMatrix ( ) const
Returns
the current model (scene) transformation.
Version
1.0
SEQ_API const ObjectManager& seq::Renderer::getObjectManager ( ) const
Returns
the object manager of this renderer.
Version
1.0
SEQ_API ObjectManager& seq::Renderer::getObjectManager ( )
Returns
the object manager of this renderer.
Version
1.0
SEQ_API const PixelViewport& seq::Renderer::getPixelViewport ( ) const
Returns
the current rendering area.
Version
1.8
SEQ_API const RenderContext& seq::Renderer::getRenderContext ( ) const
Returns
the current rendering parameters.
Version
1.4
SEQ_API const ViewData* seq::Renderer::getViewData ( ) const
Returns
the current view data.
Version
1.12
SEQ_API const Matrix4f& seq::Renderer::getViewMatrix ( ) const
Returns
the current view (frustum) transformation.
Version
1.0
SEQ_API uint32_t seq::Renderer::getWindowID ( ) const
Returns
a unique, stable identifier for the current window.
Version
1.8
SEQ_API const GLEWContext* seq::Renderer::glewGetContext ( ) const

Get the GLEW context for this renderer.

The glew context provides access to OpenGL extensions. This function does not follow the Sequel naming conventions, since GLEW uses a function of this name to automatically resolve OpenGL function entry points. Therefore, any OpenGL function support by the driver can be directly called from any method of an initialized renderer.

Returns
the extended OpenGL function table for the window's OpenGL context.
Version
1.0
virtual SEQ_API bool seq::Renderer::init ( co::Object *  initData)
inlinevirtual

Initialize the renderer.

Called once per renderer with a rendering context current before the first call to initContext().

Parameters
initDataa per-renderer instance of the object passed to Config::init().
Returns
true on success, false otherwise.
Version
1.0

Definition at line 56 of file renderer.h.

virtual SEQ_API bool seq::Renderer::initContext ( co::Object *  initData)
virtual

Initialize a rendering context.

Called for each window handled by this renderer, after the context has been created and made current.

Parameters
initDataa per-renderer instance of the object passed to Config::init().
Returns
true on success, false otherwise.
Version
1.0
SEQ_API co::Object* seq::Renderer::mapObject ( const uint128_t &  identifier,
co::Object *  instance 
)

Map and return an object.

Parameters
identifierunique object identifier used for map operation
instancealready created instance to skip factory creation
Returns
0 if not registered, the valid instance otherwise
Version
1.8
See also
co::ObjectMap::map()
virtual SEQ_API bool seq::Renderer::processEvent ( const eq::Event &  )
inlinevirtual
Warning
experimental
Returns
true when the event was handled, false if not.

Definition at line 185 of file renderer.h.

SEQ_API void seq::Renderer::requestRedraw ( )

Request another call to draw().

Version
1.12
SEQ_API void seq::Renderer::setNearFar ( const float  nearPlane,
const float  farPlane 
)

Set the near and far planes.

The given near and far planes update the current perspective and orthographics frustum accordingly.

Parameters
nearPlanethe near plane.
farPlanethe far plane.
Version
1.7.1
SEQ_API bool seq::Renderer::unmap ( co::Object *  object)

Unmap an object from the object map.

Parameters
objectthe object to unmap
Returns
false on if object was not mapped, true otherwise
Version
1.0
See also
co::ObjectMap::unmap()
SEQ_API void seq::Renderer::updateNearFar ( const Vector4f &  boundingSphere)

Update the near and far planes to tightly enclose the given sphere.

Parameters
boundingSpherethe sphere bounding of the scene to be rendered.
Version
1.7.1

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