Send light properties to shader NOTE: Light shader locations should be available
| 317 | // Send light properties to shader |
| 318 | // NOTE: Light shader locations should be available |
| 319 | static void UpdateLight(Shader shader, const Light& light) |
| 320 | { |
| 321 | SetShaderValue(shader, light.enabledLoc, &light.enabled, SHADER_UNIFORM_INT); |
| 322 | SetShaderValue(shader, light.typeLoc, &light.type, SHADER_UNIFORM_INT); |
| 323 | |
| 324 | // Send to shader light position values |
| 325 | std::array<float, 3> position = { light.position.x, light.position.y, light.position.z }; |
| 326 | SetShaderValue(shader, light.positionLoc, position.data(), SHADER_UNIFORM_VEC3); |
| 327 | |
| 328 | // Send to shader light target position values |
| 329 | std::array<float, 3> target = { light.target.x, light.target.y, light.target.z }; |
| 330 | SetShaderValue(shader, light.targetLoc, target.data(), SHADER_UNIFORM_VEC3); |
| 331 | SetShaderValue(shader, light.colorLoc, light.color.data(), SHADER_UNIFORM_VEC4); |
| 332 | SetShaderValue(shader, light.intensityLoc, &light.intensity, SHADER_UNIFORM_FLOAT); |
| 333 | } |
no outgoing calls
no test coverage detected