Basic Renderer
|
A render queue stores render calls and performs drawing in sorted order. More...
#include <RenderQueue.h>
Inherits IDrawable.
Public Types | |
typedef std::multimap< std::string, RenderCall > | RenderCallsOpaque |
typedef std::multimap< GLfloat, RenderCall > | RenderCallsTransparent |
Public Member Functions | |
RenderQueue () | |
Constructor. More... | |
virtual | ~RenderQueue () |
Virtual destructor. More... | |
virtual void | submitToRenderQueue (GLuint programID, const std::string &materialName, const std::string &drawableName, const std::string &instanceName, DrawablePtr drawable, GLfloat distanceToCamera=0.0, bool isTransparent=false, GLenum blendSfactor=GL_SRC_ALPHA, GLenum blendDfactor=GL_ONE_MINUS_SRC_ALPHA) |
Add a render call to the queue. More... | |
virtual void | draw (GLenum mode=GL_TRIANGLES) override |
Draw all drawable in the queue in a sorted manner. More... | |
virtual void | drawInstance (const std::string &instanceName, GLenum mode) override |
Draws an instance of the queue to the screen. More... | |
virtual void | clear () |
Remove all render calls. More... | |
Public Member Functions inherited from IDrawable | |
virtual | ~IDrawable () |
Virtual destructor. More... | |
A render queue stores render calls and performs drawing in sorted order.
Transparent objects are drawn in a back-to-front order whereas opaque objects are arranged in a manner that avoids state changes as much as possible.
typedef std::multimap< std::string, RenderCall> RenderQueue::RenderCallsOpaque |
typedef std::multimap< GLfloat, RenderCall> RenderQueue::RenderCallsTransparent |
|
inline |
Constructor.
|
inlinevirtual |
Virtual destructor.
|
virtual |
Remove all render calls.
|
overridevirtual |
Draw all drawable in the queue in a sorted manner.
Implements IDrawable.
|
inlineoverridevirtual |
Draws an instance of the queue to the screen.
[in] | instanceName | |
[in] | mode |
Implements IDrawable.
|
virtual |
Add a render call to the queue.
[in] | programID | |
[in] | materialName | |
[in] | drawableName | |
[in] | instanceName | |
[in] | drawable | |
[in] | distanceToCamera | The distance of the transparent drawable to the camera (optional) |
[in] | isTransparent | Set true if the object is transparent (optional) |
[in] | blendSfactor | Specifies how the red, green, blue, and alpha source blending factors are computed (optional) |
[in] | blendDfactor | Specifies how the red, green, blue, and alpha destination blending factors are computed (optional) |