Colobot
|
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. More... | |
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.
|
inline |
Add a quad to be rendered. This may trigger a call to Flush() if necessary.
|
inline |
Draw all pending quads immediately.