gawain/immediate mode: new util functions for color uniforms
This commit is contained in:
parent
f6e7e46fac
commit
e79f302f16
|
@ -32,6 +32,8 @@ set(INC
|
|||
../makesdna
|
||||
../makesrna
|
||||
|
||||
../editors/include
|
||||
|
||||
# For node muting stuff...
|
||||
../nodes
|
||||
../nodes/intern
|
||||
|
|
|
@ -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);
|
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue