Fixup for rl 3.7
This commit is contained in:
parent
a8d8d4b9bc
commit
004388133b
7 changed files with 23 additions and 24 deletions
|
|
@ -104,16 +104,16 @@ pub fn CreateLight(typ: LightType, position: Vector3, target: Vector3, color: Co
|
|||
// NOTE: Light shader locations should be available
|
||||
pub fn UpdateLightValues(shader: Shader, light: Light) void {
|
||||
// Send to shader light enabled state and type
|
||||
SetShaderValue(shader, light.enabledLoc, &light.enabled, @enumToInt(ShaderUniformDataType.UNIFORM_INT));
|
||||
SetShaderValue(shader, light.typeLoc, &light.type, @enumToInt(ShaderUniformDataType.UNIFORM_INT));
|
||||
SetShaderValue(shader, light.enabledLoc, &light.enabled, @enumToInt(ShaderUniformDataType.SHADER_UNIFORM_INT));
|
||||
SetShaderValue(shader, light.typeLoc, &light.type, @enumToInt(ShaderUniformDataType.SHADER_UNIFORM_INT));
|
||||
|
||||
// Send to shader light position values
|
||||
const position = [3]f32{ light.position.x, light.position.y, light.position.z };
|
||||
SetShaderValue(shader, light.posLoc, &position, @enumToInt(ShaderUniformDataType.UNIFORM_VEC3));
|
||||
SetShaderValue(shader, light.posLoc, &position, @enumToInt(ShaderUniformDataType.SHADER_UNIFORM_VEC3));
|
||||
|
||||
// Send to shader light target position values
|
||||
const target = [3]f32{ light.target.x, light.target.y, light.target.z };
|
||||
SetShaderValue(shader, light.targetLoc, &target, @enumToInt(ShaderUniformDataType.UNIFORM_VEC3));
|
||||
SetShaderValue(shader, light.targetLoc, &target, @enumToInt(ShaderUniformDataType.SHADER_UNIFORM_VEC3));
|
||||
|
||||
// Send to shader light color values
|
||||
const color = [4]f32{
|
||||
|
|
@ -122,5 +122,5 @@ pub fn UpdateLightValues(shader: Shader, light: Light) void {
|
|||
@intToFloat(f32, light.color.b) / 255.0,
|
||||
@intToFloat(f32, light.color.a) / 255.0,
|
||||
};
|
||||
SetShaderValue(shader, light.colorLoc, &color, @enumToInt(ShaderUniformDataType.UNIFORM_VEC4));
|
||||
SetShaderValue(shader, light.colorLoc, &color, @enumToInt(ShaderUniformDataType.SHADER_UNIFORM_VEC4));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue