diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-08-11 01:01:04 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-08-11 01:01:04 +0300 |
commit | 4aadf7331e108e7257af07d01384ce67de5e0391 (patch) | |
tree | 8d43e958cfa3c9af71e9fa03aa34b35738c217d1 /source/blender/gpu/GPU_immediate.h | |
parent | f537d96286654ba370ffdbfd7701a409d9e0c493 (diff) |
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.
Diffstat (limited to 'source/blender/gpu/GPU_immediate.h')
-rw-r--r-- | source/blender/gpu/GPU_immediate.h | 4 |
1 files changed, 3 insertions, 1 deletions
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); |