Loading...
Searching...
No Matches
Gfx::CText::CQuadBatch Class Reference

## Public Member Functions

| CQuadBatch (CEngine &engine)
void | Add (Vertex vertices[4], unsigned int texID, EngineRenderState renderState, Color color)
void | Flush ()
| Draw all pending quads immediately.

## Detailed Description

The QuadBatch is responsible for collecting as many quad (aka rectangle) draws as possible and sending them to the CDevice in one big batch. This avoids making one CDevice::DrawPrimitive call for every CText::DrawCharAndAdjustPos call, which makes text rendering much faster. Currently we only collect textured quads (ie. ones using Vertex), not untextured quads (which use VertexCol). Untextured quads are only drawn via DrawHighlight, which happens much less often than drawing textured quads.

## Member Function Documentation

## Add()

void Gfx::CText::CQuadBatch::Add | ( | Vertex | vertices[4],
|  | unsigned int | texID,
|  | EngineRenderState | renderState,
|  | Color | color )

inline

Add a quad to be rendered. This may trigger a call to Flush() if necessary.

## Flush()

void Gfx::CText::CQuadBatch::Flush | ( |  | ) |

inline

Draw all pending quads immediately.

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

- src/graphics/engine/text.cpp