Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2016-09-06 23:56:08 +0300
committerMike Erwin <significant.bit@gmail.com>2016-09-06 23:56:08 +0300
commit18d49a8283f2490b0751798685770533cc814d29 (patch)
treed6b742efcf60af45c1ebe26b97b1a03ef078f652 /source/blender/gpu/GPU_immediate.h
parent031c5bad87693f263d2ee69192fb6f7512a5f6dc (diff)
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.
Diffstat (limited to 'source/blender/gpu/GPU_immediate.h')
-rw-r--r--source/blender/gpu/GPU_immediate.h3
1 files changed, 2 insertions, 1 deletions
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);