GWN: Add GWN_batch_draw_procedural
This allow to drawn large amounts of primitives without any memory footprint.
This commit is contained in:
parent
0f3bc636c8
commit
1e9ef2a25e
|
@ -85,11 +85,9 @@ void GWN_batch_uniform_4fv(Gwn_Batch*, const char* name, const float data[4]);
|
|||
void GWN_batch_draw(Gwn_Batch*);
|
||||
|
||||
|
||||
// clement : temp stuff
|
||||
void GWN_batch_draw_stupid(Gwn_Batch*, int v_first, int v_count);
|
||||
void GWN_batch_draw_stupid_instanced(Gwn_Batch*, Gwn_Batch*, int instance_first, int instance_count);
|
||||
|
||||
|
||||
void GWN_batch_draw_procedural(Gwn_Batch*, Gwn_PrimType, int v_count);
|
||||
|
||||
|
||||
#if 0 // future plans
|
||||
|
|
|
@ -417,3 +417,18 @@ void GWN_batch_draw_stupid_instanced(Gwn_Batch* batch_instanced, Gwn_Batch* batc
|
|||
|
||||
glBindVertexArray(0);
|
||||
}
|
||||
|
||||
// just draw some vertices and let shader place them where we want.
|
||||
void GWN_batch_draw_procedural(Gwn_Batch* batch, Gwn_PrimType prim_type, int v_count)
|
||||
{
|
||||
// we cannot draw without vao ... annoying ...
|
||||
if (batch->vao_id)
|
||||
glBindVertexArray(batch->vao_id);
|
||||
else
|
||||
Batch_prime(batch);
|
||||
|
||||
GLenum type = convert_prim_type_to_gl(prim_type);
|
||||
glDrawArrays(type, 0, v_count);
|
||||
|
||||
glBindVertexArray(0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue