From 4aadf7331e108e7257af07d01384ce67de5e0391 Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Wed, 10 Aug 2016 18:01:04 -0400 Subject: Gawain: tweak immediate mode API Should be simpler to use now. Made vertex format structure private. New immVertexFormat() function clears and returns the format. Devs can start with add_attrib(format...) and not have to clear it first. immBindProgram automatically packs the vertex format if needed. Updated 3D cursor drawing to use new API. --- source/blender/gpu/GPU_immediate.h | 4 +++- 1 file changed, 3 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 1373faa236b..0ee97349970 100644 --- a/source/blender/gpu/GPU_immediate.h +++ b/source/blender/gpu/GPU_immediate.h @@ -53,11 +53,13 @@ void pack(VertexFormat*); // unsigned attrib_idx(const VertexFormat*, const char* name); void bind_attrib_locations(const VertexFormat*, GLuint program); -extern PER_THREAD VertexFormat immVertexFormat; // so we don't have to copy or pass around +// --- immediate mode work-alike -------------------------------- void immInit(void); void immDestroy(void); +VertexFormat* immVertexFormat(void); // returns a cleared vertex format, ready for add_attrib + void immBindProgram(GLuint program); void immUnbindProgram(void); -- cgit v1.2.3