Equalizer
2.0.0
Parallel Rendering Framework
|
A renderer instance. More...
#include <renderer.h>
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 RenderContext & | getRenderContext () 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 bool | processEvent (EventType) |
virtual bool | processEvent (EventType, const SizeEvent &) |
virtual bool | processEvent (EventType, const PointerEvent &) |
virtual bool | processEvent (EventType, const KeyEvent &) |
virtual bool | processEvent (EventType, const AxisEvent &) |
virtual bool | processEvent (EventType, const ButtonEvent &) |
Data Access | |
detail::Renderer * | getImpl () |
SEQ_API co::Object * | getFrameData () |
Application & | getApplication () |
const Application & | getApplication () const |
SEQ_API const ObjectManager & | getObjectManager () const |
SEQ_API ObjectManager & | getObjectManager () |
virtual SEQ_API ViewData * | createViewData (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 ViewData * | getViewData () 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... | |
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.
|
explicit |
Construct a new renderer.
|
virtual |
Destruct this renderer.
|
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.
Referenced by exit().
|
virtual |
Apply the perspective frustum matrix for the current rendering task.
Referenced by exit().
|
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.
Referenced by exit().
|
virtual |
SEQ_API void seq::Renderer::bindDrawFrameBuffer | ( | ) |
Bind the window draw buffer, which can be (multisampled) FBO or window buffer.
Referenced by exit().
|
virtual |
Clear the frame buffer.
frameData | the renderer's instance of the object passed to Config::run. |
Referenced by exit().
|
virtual |
Referenced by getApplication().
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.
view | the view requesting the view data |
Referenced by getApplication().
|
virtual |
Referenced by getApplication().
|
virtual |
Delete the given view data.
Referenced by getApplication().
|
pure virtual |
Render the scene.
frameData | the renderer's instance of the object passed to Config::run. |
Referenced by exit().
|
inlinevirtual |
De-initialize the renderer.
Called just before the last context will be destroyed after the last call to exitContext().
Definition at line 68 of file renderer.h.
References applyModelMatrix(), applyPerspectiveFrustum(), applyRenderContext(), applyScreenFrustum(), bindDrawFrameBuffer(), clear(), draw(), exitContext(), getRenderContext(), initContext(), requestRedraw(), setNearFar(), and updateNearFar().
|
virtual |
De-initialize a rendering context.
Called just before the context will be destroyed.
Referenced by exit().
|
inline |
Definition at line 205 of file renderer.h.
|
inline |
Definition at line 208 of file renderer.h.
References createObject(), createViewData(), destroyObject(), destroyViewData(), getFrustum(), getModelMatrix(), getObjectManager(), getPixelViewport(), getViewData(), getViewMatrix(), getWindowID(), glewGetContext(), mapObject(), and unmap().
SEQ_API co::Object* seq::Renderer::getFrameData | ( | ) |
Referenced by processEvent().
SEQ_API const Frustumf& seq::Renderer::getFrustum | ( | ) | const |
Referenced by getApplication().
SEQ_API const Matrix4f& seq::Renderer::getModelMatrix | ( | ) | const |
Referenced by getApplication().
SEQ_API const ObjectManager& seq::Renderer::getObjectManager | ( | ) | const |
Referenced by getApplication().
SEQ_API ObjectManager& seq::Renderer::getObjectManager | ( | ) |
SEQ_API const PixelViewport& seq::Renderer::getPixelViewport | ( | ) | const |
Referenced by getApplication().
SEQ_API const RenderContext& seq::Renderer::getRenderContext | ( | ) | const |
Referenced by exit().
SEQ_API const ViewData* seq::Renderer::getViewData | ( | ) | const |
Referenced by getApplication().
SEQ_API const Matrix4f& seq::Renderer::getViewMatrix | ( | ) | const |
Referenced by getApplication().
SEQ_API uint32_t seq::Renderer::getWindowID | ( | ) | const |
Referenced by getApplication().
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.
Referenced by getApplication().
|
inlinevirtual |
Initialize the renderer.
Called once per renderer with a rendering context current before the first call to initContext().
initData | a per-renderer instance of the object passed to Config::init(). |
Definition at line 56 of file renderer.h.
|
virtual |
Initialize a rendering context.
Called for each window handled by this renderer, after the context has been created and made current.
initData | a per-renderer instance of the object passed to Config::init(). |
Referenced by exit().
SEQ_API co::Object* seq::Renderer::mapObject | ( | const uint128_t & | identifier, |
co::Object * | instance | ||
) |
Map and return an object.
identifier | unique object identifier used for map operation |
instance | already created instance to skip factory creation |
Referenced by getApplication().
|
inlinevirtual |
Definition at line 185 of file renderer.h.
References getFrameData().
SEQ_API void seq::Renderer::requestRedraw | ( | ) |
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.
nearPlane | the near plane. |
farPlane | the far plane. |
Referenced by exit().
SEQ_API bool seq::Renderer::unmap | ( | co::Object * | object | ) |
Unmap an object from the object map.
object | the object to unmap |
Referenced by getApplication().
SEQ_API void seq::Renderer::updateNearFar | ( | const Vector4f & | boundingSphere | ) |
Update the near and far planes to tightly enclose the given sphere.
boundingSphere | the sphere bounding of the scene to be rendered. |
Referenced by exit().