[Bf-blender-cvs] [6b34eed] blender2.8: Gawain: add v functions to immediate mode
Mike Erwin
noreply at git.blender.org
Wed Aug 17 03:56:18 CEST 2016
Commit: 6b34eed21735405099d5970ffae944bebb489a86
Author: Mike Erwin
Date: Tue Aug 16 21:45:17 2016 -0400
Branches: blender2.8
https://developer.blender.org/rB6b34eed21735405099d5970ffae944bebb489a86
Gawain: add v functions to immediate mode
Legacy OpenGL has a matching Vertex3fv for every Vertex3f, and so on. Add something similar to Gawain, just for a few common functions. Might add more as the need arises.
===================================================================
M source/blender/gpu/GPU_immediate.h
M source/blender/gpu/intern/gpu_immediate.c
===================================================================
diff --git a/source/blender/gpu/GPU_immediate.h b/source/blender/gpu/GPU_immediate.h
index 0ee9734..7c2b35c 100644
--- a/source/blender/gpu/GPU_immediate.h
+++ b/source/blender/gpu/GPU_immediate.h
@@ -72,12 +72,14 @@ void immAttrib3f(unsigned attrib_id, float x, float y, float z);
void immAttrib3ub(unsigned attrib_id, unsigned char r, unsigned char g, unsigned char b);
void immAttrib4ub(unsigned attrib_id, unsigned char r, unsigned char g, unsigned char b, unsigned char a);
+void immAttrib4ubv(unsigned attrib_id, const unsigned char data[4]);
void immEndVertex(void); // and move on to the next vertex
// provide 2D or 3D attribute value and end the current vertex, similar to glVertex:
void immVertex2f(unsigned attrib_id, float x, float y);
void immVertex3f(unsigned attrib_id, float x, float y, float z);
+void immVertex3fv(unsigned attrib_id, const float data[3]);
// provide values that don't change for the entire draw call
void immUniform4f(const char* name, float x, float y, float z, float w);
diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c
index e8a59c4..3065a3e 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -616,6 +616,11 @@ void immAttrib4ub(unsigned attrib_id, unsigned char r, unsigned char g, unsigned
data[3] = a;
}
+void immAttrib4ubv(unsigned attrib_id, const unsigned char data[4])
+ {
+ immAttrib4ub(attrib_id, data[0], data[1], data[2], data[3]);
+ }
+
void immEndVertex()
{
#if TRUST_NO_ONE
@@ -664,6 +669,12 @@ void immVertex3f(unsigned attrib_id, float x, float y, float z)
immEndVertex();
}
+void immVertex3fv(unsigned attrib_id, const float data[3])
+ {
+ immAttrib3f(attrib_id, data[0], data[1], data[2]);
+ immEndVertex();
+ }
+
void immUniform4f(const char* name, float x, float y, float z, float w)
{
int loc = glGetUniformLocation(imm.bound_program, name);
More information about the Bf-blender-cvs
mailing list