X3D libraries
The libraries to work with X3D dataset

x3drender::RenderProcessor Class Reference

The interface that a rendering processor implements. More...

#include <render.h>

Inheritance diagram for x3drender::RenderProcessor:

Inheritance graph
Collaboration diagram for x3drender::RenderProcessor:

Collaboration graph
List of all members.

Public Member Functions

virtual RenderShapeCreateShape (RenderState *render_state) const =0
 Create a shape to be used with a render state.
virtual bool Render (RenderState *render_state)=0
 Render everything at the current time.
virtual ~RenderProcessor ()
 Cleans up a render processor object.

Detailed Description

The interface that a rendering processor implements.

Constructor & Destructor Documentation

x3drender::RenderProcessor::~RenderProcessor  )  [virtual]

Cleans up a render processor object.

The class is virtual and thus we added a virtual destructor.

Member Function Documentation

RenderShape * x3drender::RenderProcessor::CreateShape RenderState render_state  )  const [pure virtual]

Create a shape to be used with a render state.

This function will be called by the RenderState whenever it needs to create a shape to use in its array of shapes. The function will be used to create a shape which is compatible with the shapes expected by the render processor.

For instance, in OpenGL, the shapes record an OpenGL list identifier. For this reason, we want a specialised shape. It is done this way.

At this time the function returns a bare pointer. I may change it later so it returns a smart pointer.
See also:

Implemented in x3dgl::OpenGLProcessor.

bool x3drender::RenderProcessor::Render RenderState render_state  )  [pure virtual]

Render everything at the current time.

This function is usually called by a user to render the scene at the current time.

It is expected to process the data using the Execute() function of the RenderState more or less in the following order:

  • call a 'get ready' function (dirty shapes can react by reinitializing themselves)
  • call a sort function if it seems necessary (tbd and also tbw -- to be written)
  • call a 'render' function to draw the shapes on screen

Implemented in x3dgl::OpenGLProcessor.

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