From 18d49a8283f2490b0751798685770533cc814d29 Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Tue, 6 Sep 2016 16:56:08 -0400 Subject: Gawain: add immBeginAtMost immBegin requires us to know how many vertices will be drawn. Most times this is fine, but sometimes it can be tricky. Do we make the effort to count everything in one pass, then draw it in a second? immBeginAtMost makes this simple. Example: I'll draw at most 100 vertices. Supply only 6 verts and it draws only 6. Any unused space is reclaimed and given to the next immBegin. --- source/blender/gpu/GPU_immediate.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/gpu/GPU_immediate.h') diff --git a/source/blender/gpu/GPU_immediate.h b/source/blender/gpu/GPU_immediate.h index 6bcfdc74ef6..ffd0a6d5afc 100644 --- a/source/blender/gpu/GPU_immediate.h +++ b/source/blender/gpu/GPU_immediate.h @@ -63,7 +63,8 @@ VertexFormat* immVertexFormat(void); // returns a cleared vertex format, ready f void immBindProgram(GLuint program); void immUnbindProgram(void); -void immBegin(GLenum primitive, unsigned vertex_ct); +void immBegin(GLenum primitive, unsigned vertex_ct); // must supply exactly vertex_ct vertices +void immBeginAtMost(GLenum primitive, unsigned max_vertex_ct); // can supply fewer vertices void immEnd(void); void immAttrib1f(unsigned attrib_id, float x); -- cgit v1.2.3