Torque2D Reference
Loading...
Searching...
No Matches
BatchRender Class Reference

#include <BatchRender.h>

Public Member Functions

 BatchRender ()
virtual ~BatchRender ()
void setStrictOrderMode (const bool strictOrder, const bool forceFlush=false)
 Set the strict order mode.
bool getStrictOrderMode (void) const
 Gets the strict order mode.
void setBlendMode (GLenum srcFactor, GLenum dstFactor, const ColorF &blendColor=ColorF(1.0f, 1.0f, 1.0f, 1.0f))
 Turns-on blend mode with the specified blend factors and color.
void setBlendOff (void)
 Turns-off blend mode.
void setBlendMode (const SceneRenderRequest *pSceneRenderRequest)
void setAlphaTestMode (const F32 alphaTestMode)
 Set alpha-test mode.
void setAlphaTestMode (const SceneRenderRequest *pSceneRenderRequest)
void setWireframeMode (const bool enabled)
 Sets the wireframe mode.
bool getWireframeMode (void) const
void setBatchEnabled (const bool enabled)
 Sets the batch enabled mode.
bool getBatchEnabled (void) const
 Gets the batch enabled mode.
void setDebugStats (DebugStats *pDebugStats)
 Sets the debug stats to use.
void SubmitTriangles (const U32 vertexCount, const Vector2 *pVertexArray, const Vector2 *pTextureArray, const ColorF *pColorArray, TextureHandle &texture)
void SubmitQuad (const Vector2 &vertexPos0, const Vector2 &vertexPos1, const Vector2 &vertexPos2, const Vector2 &vertexPos3, const Vector2 &texturePos0, const Vector2 &texturePos1, const Vector2 &texturePos2, const Vector2 &texturePos3, TextureHandle &texture, const ColorF &color0=ColorF(-1.0f, -1.0f, -1.0f), const ColorF &color1=ColorF(-1.0f, -1.0f, -1.0f), const ColorF &color2=ColorF(-1.0f, -1.0f, -1.0f), const ColorF &color3=ColorF(-1.0f, -1.0f, -1.0f))
void flush (U32 &reasonMetric)
 Flush (render) any pending batches with a reason metric.
void flush (void)
 Flush (render) any pending batches.

Static Public Member Functions

static void RenderQuad (const Vector2 &vertexPos0, const Vector2 &vertexPos1, const Vector2 &vertexPos2, const Vector2 &vertexPos3, const Vector2 &texturePos0, const Vector2 &texturePos1, const Vector2 &texturePos2, const Vector2 &texturePos3)

Static Public Attributes

static const U32 maxVertexCount = BATCHRENDER_BUFFERSIZE

Constructor & Destructor Documentation

◆ BatchRender()

◆ ~BatchRender()

~BatchRender ( )
virtual

Member Function Documentation

◆ flush() [1/2]

void flush ( U32 & reasonMetric)

Flush (render) any pending batches with a reason metric.

◆ flush() [2/2]

void flush ( void )

Flush (render) any pending batches.

◆ getBatchEnabled()

bool getBatchEnabled ( void ) const
inline

Gets the batch enabled mode.

◆ getStrictOrderMode()

bool getStrictOrderMode ( void ) const
inline

Gets the strict order mode.

◆ getWireframeMode()

bool getWireframeMode ( void ) const
inline

◆ RenderQuad()

void RenderQuad ( const Vector2 & vertexPos0,
const Vector2 & vertexPos1,
const Vector2 & vertexPos2,
const Vector2 & vertexPos3,
const Vector2 & texturePos0,
const Vector2 & texturePos1,
const Vector2 & texturePos2,
const Vector2 & texturePos3 )
inlinestatic

Render a quad immediately without affecting current batch. All render state should be set beforehand directly. Vertex and textures are indexed as: 3 ___ 2 |\ | | \ | 0| _|1

◆ setAlphaTestMode() [1/2]

void setAlphaTestMode ( const F32 alphaTestMode)
inline

Set alpha-test mode.

◆ setAlphaTestMode() [2/2]

void setAlphaTestMode ( const SceneRenderRequest * pSceneRenderRequest)

◆ setBatchEnabled()

void setBatchEnabled ( const bool enabled)
inline

Sets the batch enabled mode.

◆ setBlendMode() [1/2]

void setBlendMode ( const SceneRenderRequest * pSceneRenderRequest)

◆ setBlendMode() [2/2]

void setBlendMode ( GLenum srcFactor,
GLenum dstFactor,
const ColorF & blendColor = ColorF(1.0f, 1.0f, 1.0f, 1.0f) )
inline

Turns-on blend mode with the specified blend factors and color.

◆ setBlendOff()

void setBlendOff ( void )
inline

Turns-off blend mode.

◆ setDebugStats()

void setDebugStats ( DebugStats * pDebugStats)
inline

Sets the debug stats to use.

◆ setStrictOrderMode()

void setStrictOrderMode ( const bool strictOrder,
const bool forceFlush = false )
inline

Set the strict order mode.

◆ setWireframeMode()

void setWireframeMode ( const bool enabled)
inline

Sets the wireframe mode.

◆ SubmitQuad()

void SubmitQuad ( const Vector2 & vertexPos0,
const Vector2 & vertexPos1,
const Vector2 & vertexPos2,
const Vector2 & vertexPos3,
const Vector2 & texturePos0,
const Vector2 & texturePos1,
const Vector2 & texturePos2,
const Vector2 & texturePos3,
TextureHandle & texture,
const ColorF & color0 = ColorF(-1.0f, -1.0f, -1.0f),
const ColorF & color1 = ColorF(-1.0f, -1.0f, -1.0f),
const ColorF & color2 = ColorF(-1.0f, -1.0f, -1.0f),
const ColorF & color3 = ColorF(-1.0f, -1.0f, -1.0f) )

Submit a quad for batching. Vertex and textures are indexed as: 3 ___ 2 |\ | | \ | 0| _|1

◆ SubmitTriangles()

void SubmitTriangles ( const U32 vertexCount,
const Vector2 * pVertexArray,
const Vector2 * pTextureArray,
const ColorF * pColorArray,
TextureHandle & texture )

Submit triangles for batching. Vertex and textures are indexed as: 2 5 |\ |\ | \ | \ 0| _\1 3| _\4

Member Data Documentation

◆ maxVertexCount

const U32 maxVertexCount = BATCHRENDER_BUFFERSIZE
static

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