mirror of https://github.com/raysan5/raylib
ADDED: more uniform data type options #4137
This commit is contained in:
parent
dec7f12b14
commit
157c7c21d4
|
@ -527,6 +527,10 @@ typedef enum {
|
|||
RL_SHADER_UNIFORM_IVEC2, // Shader uniform type: ivec2 (2 int)
|
||||
RL_SHADER_UNIFORM_IVEC3, // Shader uniform type: ivec3 (3 int)
|
||||
RL_SHADER_UNIFORM_IVEC4, // Shader uniform type: ivec4 (4 int)
|
||||
RL_SHADER_UNIFORM_UINT, // Shader uniform type: unsigned int
|
||||
RL_SHADER_UNIFORM_UIVEC2, // Shader uniform type: uivec2 (2 unsigned int)
|
||||
RL_SHADER_UNIFORM_UIVEC3, // Shader uniform type: uivec3 (3 unsigned int)
|
||||
RL_SHADER_UNIFORM_UIVEC4, // Shader uniform type: uivec4 (4 unsigned int)
|
||||
RL_SHADER_UNIFORM_SAMPLER2D // Shader uniform type: sampler2d
|
||||
} rlShaderUniformDataType;
|
||||
|
||||
|
@ -4236,6 +4240,10 @@ void rlSetUniform(int locIndex, const void *value, int uniformType, int count)
|
|||
case RL_SHADER_UNIFORM_IVEC2: glUniform2iv(locIndex, count, (int *)value); break;
|
||||
case RL_SHADER_UNIFORM_IVEC3: glUniform3iv(locIndex, count, (int *)value); break;
|
||||
case RL_SHADER_UNIFORM_IVEC4: glUniform4iv(locIndex, count, (int *)value); break;
|
||||
case RL_SHADER_UNIFORM_UINT: glUniform1uiv(locIndex, count, (unsigned int *)value); break;
|
||||
case RL_SHADER_UNIFORM_UIVEC2: glUniform2uiv(locIndex, count, (unsigned int *)value); break;
|
||||
case RL_SHADER_UNIFORM_UIVEC3: glUniform3uiv(locIndex, count, (unsigned int *)value); break;
|
||||
case RL_SHADER_UNIFORM_UIVEC4: glUniform4uiv(locIndex, count, (unsigned int *)value); break;
|
||||
case RL_SHADER_UNIFORM_SAMPLER2D: glUniform1iv(locIndex, count, (int *)value); break;
|
||||
default: TRACELOG(RL_LOG_WARNING, "SHADER: Failed to set uniform value, data type not recognized");
|
||||
|
||||
|
|
Loading…
Reference in New Issue