Commit: e79f302f1613adfb957c2f8f5fca50aba7f25259
Author: Dalai Felinto
Date:   Wed Oct 12 23:01:59 2016 +0000
Branches: blender2.8
https://developer.blender.org/rBe79f302f1613adfb957c2f8f5fca50aba7f25259

gawain/immediate mode: new util functions for color uniforms

===================================================================

M       source/blender/gpu/CMakeLists.txt
M       source/blender/gpu/GPU_immediate.h
M       source/blender/gpu/intern/gpu_immediate.c

===================================================================

diff --git a/source/blender/gpu/CMakeLists.txt 
b/source/blender/gpu/CMakeLists.txt
index 668a948..2a5df19 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -32,6 +32,8 @@ set(INC
        ../makesdna
        ../makesrna
 
+       ../editors/include
+
        # For node muting stuff...
        ../nodes
        ../nodes/intern
diff --git a/source/blender/gpu/GPU_immediate.h 
b/source/blender/gpu/GPU_immediate.h
index 8e7f91b..96b8cbb 100644
--- a/source/blender/gpu/GPU_immediate.h
+++ b/source/blender/gpu/GPU_immediate.h
@@ -37,3 +37,9 @@
 /* Extend immBindProgram to use Blender’s library of built-in shader programs.
  * Use immUnbindProgram() when done. */
 void immBindBuiltinProgram(GPUBuiltinShader);
+
+/*
+ * Extend immUniformColor to take Blender's themes
+ */
+void immUniformThemeColor(int colorid);
+void immUniformThemeColorShade(int colorid, int offset);
\ No newline at end of file
diff --git a/source/blender/gpu/intern/gpu_immediate.c 
b/source/blender/gpu/intern/gpu_immediate.c
index 5faedba..444a885 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -27,6 +27,8 @@
 
 #include "GPU_immediate.h"
 #include "GPU_matrix.h"
+#include "UI_resources.h"
+
 #include "gpu_shader_private.h"
 
 void immBindBuiltinProgram(GPUBuiltinShader shader_id)
@@ -35,3 +37,17 @@ void immBindBuiltinProgram(GPUBuiltinShader shader_id)
        immBindProgram(shader->program);
        gpuBindMatrices(shader->program);
 }
+
+void immUniformThemeColor(int colorid)
+{
+       float color[4];
+       UI_GetThemeColor4fv(colorid, color);
+       immUniformColor4fv(color);
+}
+
+void immUniformThemeColorShade(int colorid, int offset)
+{
+       float color[4];
+       UI_GetThemeColorShade4fv(colorid, offset, color);
+       immUniformColor4fv(color);
+}
\ No newline at end of file

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to