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:
Diffstat (limited to 'source/blender/gpu/intern/gpu_immediate.c')
-rw-r--r--source/blender/gpu/intern/gpu_immediate.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c
index d250bcc78f9..7d32ba3f8d9 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -729,3 +729,15 @@ void immUniform4f(const char* name, float x, float y, float z, float w)
glUniform4f(loc, x, y, z, w);
}
+
+void immUniformColor3ubv(const unsigned char rgb[3])
+ {
+ const float scale = 1.0f / 255.0f;
+ immUniform4f("color", scale * rgb[0], scale * rgb[1], scale * rgb[2], 1.0f);
+ }
+
+void immUniformColor4ubv(const unsigned char rgba[4])
+ {
+ const float scale = 1.0f / 255.0f;
+ immUniform4f("color", scale * rgba[0], scale * rgba[1], scale * rgba[2], rgba[3]);
+ }