1 #ifndef B_RENDERQUEUE_H
2 #define B_RENDERQUEUE_H
54 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);
58 virtual void draw(GLenum mode = GL_TRIANGLES)
override;
64 virtual void drawInstance(
const std::string &instanceName, GLenum mode)
override {
draw(mode); }
75 RenderCallsOpaque _renderCallsOpaque;
76 RenderCallsTransparent _renderCallsTransparent;
DrawablePtr drawable
Definition: RenderQueue.h:15
A render queue stores render calls and performs drawing in sorted order.
Definition: RenderQueue.h:26
GLenum blendSfactor
Definition: RenderQueue.h:17
virtual ~RenderQueue()
Virtual destructor.
Definition: RenderQueue.h:41
std::multimap< std::string, RenderCall > RenderCallsOpaque
Definition: RenderQueue.h:30
An interface for drawable objects.
Definition: IDrawable.h:9
std::string instanceName
Definition: RenderQueue.h:16
GLenum blendDfactor
Definition: RenderQueue.h:17
virtual void drawInstance(const std::string &instanceName, GLenum mode) override
Draws an instance of the queue to the screen.
Definition: RenderQueue.h:64
RenderQueue()
Constructor.
Definition: RenderQueue.h:37
Definition: RenderQueue.h:13
virtual void clear()
Remove all render calls.
Definition: RenderQueue.cpp:33
std::shared_ptr< IDrawable > DrawablePtr
Definition: IDrawable.h:30
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.
Definition: RenderQueue.cpp:3
std::multimap< GLfloat, RenderCall > RenderCallsTransparent
Definition: RenderQueue.h:31
std::shared_ptr< RenderQueue > RenderQueuePtr
Definition: RenderQueue.h:80
virtual void draw(GLenum mode=GL_TRIANGLES) override
Draw all drawable in the queue in a sorted manner.
Definition: RenderQueue.cpp:16