Basic Image AlgorithmS Library
2.8.0
|
A batch represents a single Draw call including all parameters (render states). More...
#include <OpenGLFramework/Base/glfBatch.hh>
Public Member Functions | |
void | Draw () |
Draws the batch. More... | |
unsigned int | GetMaxUsedTextureIndex () |
unsigned int | GetMaxUsedTextureMatrixIndex () const |
glfBatch () | |
void | Init () |
void | ReleaseTextureMatrices (unsigned int fromIndex) |
Releases texture matrices including the matrix associated with the argument index. More... | |
void | ReleaseTextures (unsigned int fromIndex) |
Releases texture including the matrix associated with the argument index. More... | |
void | SetBlendMode (const glfBlendMode *blendMode) |
Sets the blend mode. More... | |
void | SetDepthBufferMode (const glfDepthBufferMode *depthBufferMode) |
Sets the depth buffer mode. More... | |
void | SetElementBuffer (const glfElementBuffer *elementBuffer) |
Sets the element buffer. More... | |
void | SetModelViewMatrix (const glfMatrix *matrix) |
Sets the modelview matrix. More... | |
void | SetPrimitiveType (GLenum primitiveType) |
Sets the primitive type to rendering. More... | |
void | SetProjectionMatrix (const glfMatrix *matrix) |
Sets the projection matrix. More... | |
void | SetRange (int first, int count) |
Sets the range of vertices to be rendered if no element buffer is set, or the range of vertex indices if an element buffer is set. More... | |
void | SetRenderTarget (const glfRenderTarget *renderTarget) |
Sets the render target. More... | |
void | SetShaderProgram (const glfShaderProgram *shaderProgram) |
Sets the shader program. More... | |
void | SetStencilBufferMode (const glfStencilBufferMode *stencilBufferMode) |
Sets the stencil buffer mode. More... | |
void | SetTexture (const glfTexture *texture, int textureUnit) |
Sets the texture of a texture unit. More... | |
void | SetTextureMatrix (const glfMatrix *matrix, int index) |
Sets a texture matrix. More... | |
void | SetVertexBuffer (const glfVertexBuffer *vertexBuffer) |
Sets the vertex buffer. More... | |
void | SetViewport (const glfViewport *viewport) |
Sets the viewport. More... | |
~glfBatch () | |
Static Public Member Functions | |
static int | GetMaxSupportedTextureMatrices () |
static int | GetMaxSupportedTextureUnits () |
static void | SetDefaultRenderStates () |
Sets all render states possibly modified by Batch to the OpenGL defaults. More... | |
A batch represents a single Draw call including all parameters (render states).
Definition at line 48 of file glfBatch.hh.
glfBatch::glfBatch | ( | ) |
Definition at line 33 of file glfBatch.cpp.
References BIAS::glfBlendMode::DEFAULT, BIAS::glfDepthBufferMode::DEFAULT, BIAS::glfStencilBufferMode::DEFAULT, BIAS::glfScreen::GetInstance(), and BIAS::glfMatrix::IDENTITY.
glfBatch::~glfBatch | ( | ) |
Definition at line 55 of file glfBatch.cpp.
void glfBatch::Draw | ( | ) |
Draws the batch.
Definition at line 218 of file glfBatch.cpp.
References BIAS::glfElementBuffer::Draw(), and BIAS::glfVertexBuffer::GetNumVertices().
Referenced by BIAS::SeparableBilateralFilter::Draw(), BIAS::DistortionRendering::EndRendering(), BIAS::PlainPerPixelProcessing::Execute(), BIAS::TemplateSpecializedBatch::Execute(), and BIAS::SimpleMultiPassFragmentShader::Execute().
|
static |
Definition at line 330 of file glfBatch.cpp.
Referenced by Init(), and SetDefaultRenderStates().
|
static |
Definition at line 323 of file glfBatch.cpp.
Referenced by Init(), and SetDefaultRenderStates().
unsigned int glfBatch::GetMaxUsedTextureIndex | ( | ) |
Definition at line 100 of file glfBatch.cpp.
unsigned int glfBatch::GetMaxUsedTextureMatrixIndex | ( | ) | const |
Definition at line 193 of file glfBatch.cpp.
void glfBatch::Init | ( | ) |
Definition at line 198 of file glfBatch.cpp.
References GetMaxSupportedTextureMatrices(), and GetMaxSupportedTextureUnits().
void glfBatch::ReleaseTextureMatrices | ( | unsigned int | fromIndex | ) |
Releases texture matrices including the matrix associated with the argument index.
Definition at line 182 of file glfBatch.cpp.
References SetTextureMatrix().
void glfBatch::ReleaseTextures | ( | unsigned int | fromIndex | ) |
Releases texture including the matrix associated with the argument index.
Definition at line 90 of file glfBatch.cpp.
References SetTexture().
Referenced by BIAS::PlainPerPixelProcessing::ReleaseTextures().
void glfBatch::SetBlendMode | ( | const glfBlendMode * | blendMode | ) |
Sets the blend mode.
Defaults to GL Default. If passed NULL, the currently set GL state is used!
Definition at line 118 of file glfBatch.cpp.
|
static |
Sets all render states possibly modified by Batch to the OpenGL defaults.
Should be called before using an external library that uses OpenGL.
todo: this loop made problems with open scene graph for SIGGRAPH09, fkellner
Definition at line 337 of file glfBatch.cpp.
References BIAS::glfScreen::Bind(), BIAS::glfBlendMode::Bind(), BIAS::glfDepthBufferMode::Bind(), BIAS::glfStencilBufferMode::Bind(), BIAS::glfBlendMode::DEFAULT, BIAS::glfDepthBufferMode::DEFAULT, BIAS::glfStencilBufferMode::DEFAULT, BIAS::glfScreen::GetInstance(), GetMaxSupportedTextureMatrices(), and GetMaxSupportedTextureUnits().
Referenced by BIAS::ImageWarper< StorageType >::Process(), and BIAS::ImageWarper< StorageType >::ProcessWithColor().
void glfBatch::SetDepthBufferMode | ( | const glfDepthBufferMode * | depthBufferMode | ) |
Sets the depth buffer mode.
Defaults to GL Default. If passed NULL, the currently set GL state is used!
Definition at line 106 of file glfBatch.cpp.
Referenced by BIAS::DistortionRendering::Init(), BIAS::PlainPerPixelProcessing::InitBatch_(), and BIAS::TemplateSpecializedBatch::InitBatch_().
void glfBatch::SetElementBuffer | ( | const glfElementBuffer * | elementBuffer | ) |
Sets the element buffer.
NULL is allowed. If no element buffer is used, you call Batch::SetPrimitiveType and vertices will be rendered straight from the vertex buffer.
Definition at line 134 of file glfBatch.cpp.
Referenced by BIAS::PlainPerPixelProcessing::InitBatch_(), BIAS::TemplateSpecializedBatch::InitBatch_(), and BIAS::PMDWarp::SetupDefaultPrimitiveRendering_().
void glfBatch::SetModelViewMatrix | ( | const glfMatrix * | matrix | ) |
Sets the modelview matrix.
Must be non-NULL. Default is the identity matrix.
Definition at line 150 of file glfBatch.cpp.
Referenced by BIAS::PlainPerPixelProcessing::InitBatch_(), and BIAS::TemplateSpecializedBatch::InitBatch_().
void glfBatch::SetPrimitiveType | ( | GLenum | primitiveType | ) |
Sets the primitive type to rendering.
This is used only if no element buffer is provided. Valid primitive types are be GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON.
Definition at line 139 of file glfBatch.cpp.
void glfBatch::SetProjectionMatrix | ( | const glfMatrix * | matrix | ) |
Sets the projection matrix.
Must be non-NULL. Default is the identity matrix.
Definition at line 156 of file glfBatch.cpp.
Referenced by BIAS::PlainPerPixelProcessing::InitBatch_(), and BIAS::TemplateSpecializedBatch::InitBatch_().
void glfBatch::SetRange | ( | int | first, |
int | count | ||
) |
Sets the range of vertices to be rendered if no element buffer is set, or the range of vertex indices if an element buffer is set.
By default, all geometry will be rendered.
Definition at line 144 of file glfBatch.cpp.
void glfBatch::SetRenderTarget | ( | const glfRenderTarget * | renderTarget | ) |
Sets the render target.
Must be non-NULL. Default render target is 'glfScreen'.
Definition at line 59 of file glfBatch.cpp.
Referenced by BIAS::SimpleMultiPassFragmentShader::Execute(), BIAS::DistortionRendering::Init(), BIAS::TemplateSpecializedBatch::SetRenderTarget(), and BIAS::PlainPerPixelProcessing::SetRenderTarget().
void glfBatch::SetShaderProgram | ( | const glfShaderProgram * | shaderProgram | ) |
Sets the shader program.
NULL is allowed. If the shader program is NULL, the fixed-function pipeline is used.
Definition at line 124 of file glfBatch.cpp.
Referenced by BIAS::SimpleMultiPassFragmentShader::Execute(), BIAS::DistortionRendering::Init(), BIAS::PlainPerPixelProcessing::InitBatch_(), and BIAS::TemplateSpecializedBatch::InitBatch_().
void glfBatch::SetStencilBufferMode | ( | const glfStencilBufferMode * | stencilBufferMode | ) |
Sets the stencil buffer mode.
Defaults to GL Default. If passed NULL, the currently set GL state is used!
Definition at line 112 of file glfBatch.cpp.
void glfBatch::SetTexture | ( | const glfTexture * | texture, |
int | textureUnit | ||
) |
Sets the texture of a texture unit.
NULL is allowed. Defaults are NULL. If a texture of a texture unit is NULL, it should not be used.
Definition at line 71 of file glfBatch.cpp.
Referenced by BIAS::SeparableBilateralFilter::Draw(), BIAS::SimpleMultiPassFragmentShader::Execute(), BIAS::DistortionRendering::Init(), BIAS::TemplateSpecializedBatch::InitBatch_(), ReleaseTextures(), BIAS::PlainPerPixelProcessing::SetTexture(), and BIAS::PlainPerPixelProcessing::SetTextures().
void glfBatch::SetTextureMatrix | ( | const glfMatrix * | matrix, |
int | index | ||
) |
Sets a texture matrix.
NULL is allowed. If a texture matrix is NULL, it will not be set and is undefined. Make sure to not use a texture matrix that is not set.
Definition at line 162 of file glfBatch.cpp.
Referenced by ReleaseTextureMatrices().
void glfBatch::SetVertexBuffer | ( | const glfVertexBuffer * | vertexBuffer | ) |
Sets the vertex buffer.
Must be non-NULL.
Definition at line 129 of file glfBatch.cpp.
Referenced by BIAS::PlainPerPixelProcessing::InitBatch_(), BIAS::TemplateSpecializedBatch::InitBatch_(), and BIAS::PMDWarp::SetupDefaultPrimitiveRendering_().
void glfBatch::SetViewport | ( | const glfViewport * | viewport | ) |
Sets the viewport.
Must be non-NULL. There is no default viewport, so you must set one.
Definition at line 65 of file glfBatch.cpp.
Referenced by BIAS::DistortionRendering::Init(), BIAS::PlainPerPixelProcessing::InitBatch_(), and BIAS::TemplateSpecializedBatch::InitBatch_().