Starts rendering of user's graphic primitives batch.
- Type of graphic primitives to be rendered:
HGEPRIM_LINES - lines
HGEPRIM_TRIPLES - triples
HGEPRIM_QUADS - quads
- Handle of the texture to use or 0.
- Blending mode.
- Pointer to an int that will receive the maximum number of primitives allowed within a single batch.
If successful, returns pointer to the vertex buffer to be filled with vertices and stores the maximum allowed number
of primitives into max_prim. Otherwise returns 0.
Gfx_StartBatch is a backdoor to the heart of HGE and DirectX for expert use.
It provides direct access to hardware vertex buffer and allows extremely fast rendering of large
arrays of graphic primitives. This may be used for tasks like sofisticated geometry or texture effects
or complex precalculated objects rendering.
Gfx_StartBatch function must be called between the Gfx_BeginScene
and Gfx_EndScene calls. To finish a batch use
Gfx_FinishBatch function. No other rendering functions
are allowed inside Gfx_StartBatch/Gfx_FinishBatch calls pair.
Vertex buffer size is constant and unlikely to change. It can hold up to 1000 quads / 1333 triples /
2000 lines. You should write to the buffer 2 vertices per line, 3 vertices per triple or 4 vertices per quad.
The actual number of primitives written to the buffer should be passed to Gfx_FinishBatch.
Gfx_StartBatch flushes all previously accumulated graphic primitives.
Import library: hge.lib