Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Static Public Member Functions | List of all members
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. More...
bool | getStrictOrderMode (void) const
| Gets the strict order mode. More...
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. More...
void | setBlendOff (void)
| Turns-off blend mode. More...
void | setBlendMode (const SceneRenderRequest *pSceneRenderRequest)
void | setAlphaTestMode (const F32 alphaTestMode)
| Set alpha-test mode. More...
void | setAlphaTestMode (const SceneRenderRequest *pSceneRenderRequest)
void | setWireframeMode (const bool enabled)
| Sets the wireframe mode. More...
bool | getWireframeMode (void) const
void | setBatchEnabled (const bool enabled)
| Sets the batch enabled mode. More...
bool | getBatchEnabled (void) const
| Gets the batch enabled mode. More...
void | setDebugStats (DebugStats *pDebugStats)
| Sets the debug stats to use. More...
void | SubmitTriangles (const U32 vertexCount, const Vector2 *pVertexArray, const Vector2 *pTextureArray, TextureHandle &texture, const ColorF &color=ColorF(-1.0f,-1.0f,-1.0f))
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 &color=ColorF(-1.0f,-1.0f,-1.0f))
void | flush (U32 &reasonMetric)
| Flush (render) any pending batches with a reason metric. More...
void | flush (void)
| Flush (render) any pending batches. More...

## 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)

## Constructor & Destructor Documentation

BatchRender | ( |  | ) |

~BatchRender | ( |  | ) |
| virtual

## Member Function Documentation

void flush | ( | U32 & | reasonMetric | ) |

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

void flush | ( | void |  | ) |

Flush (render) any pending batches.

bool getBatchEnabled | ( | void |  | ) | const
| inline

Gets the batch enabled mode.

bool getStrictOrderMode | ( | void |  | ) | const
| inline

Gets the strict order mode.

bool getWireframeMode | ( | void |  | ) | const
| inline

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
| ) |  |
| inline static

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

void setAlphaTestMode | ( | const F32 | alphaTestMode | ) |
| inline

Set alpha-test mode.

void setAlphaTestMode | ( | const SceneRenderRequest * | pSceneRenderRequest | ) |

void setBatchEnabled | ( | const bool | enabled | ) |
| inline

Sets the batch enabled mode.

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.

void setBlendMode | ( | const SceneRenderRequest * | pSceneRenderRequest | ) |

void setBlendOff | ( | void |  | ) |
| inline

Turns-off blend mode.

void setDebugStats | ( | DebugStats * | pDebugStats | ) |
| inline

Sets the debug stats to use.

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

Set the strict order mode.

void setWireframeMode | ( | const bool | enabled | ) |
| inline

Sets the wireframe mode.

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 & | color = `ColorF(-1.0f, -1.0f, -1.0f)`
| ) |  |

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

void SubmitTriangles | ( | const U32 | vertexCount,
|  | const Vector2 * | pVertexArray,
|  | const Vector2 * | pTextureArray,
|  | TextureHandle & | texture,
|  | const ColorF & | color = `ColorF(-1.0f, -1.0f, -1.0f)`
| ) |  |

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

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

- 2d/core/BatchRender.h
- 2d/core/BatchRender.cc