MCPcopy Create free account
hub / github.com/electronstudio/raylib-python-cffi / UpdateLightValues

Method UpdateLightValues

examples/shaders/light_system.py:81–96  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

79 #// Send light properties to shader
80 #// NOTE: Light shader locations should be available
81 def UpdateLightValues(self):
82 #// Send to shader light enabled state and type
83 rl.SetShaderValue(self.shader, self.enabledLoc, rl.ffi.new("int *",self.enabled), rl.SHADER_UNIFORM_INT)
84 rl.SetShaderValue(self.shader, self.typeLoc, rl.ffi.new("int *",self.type), rl.SHADER_UNIFORM_INT)
85
86 #// Send to shader light position values
87 position = [ self.position.x, self.position.y, self.position.z]
88 rl.SetShaderValue(self.shader, self.posLoc, rl.ffi.new("struct Vector3 *",position), rl.SHADER_UNIFORM_VEC3)
89
90 #// Send to shader light target position values
91 target =[ self.target.x, self.target.y, self.target.z ]
92 rl.SetShaderValue(self.shader, self.targetLoc, rl.ffi.new("struct Vector3 *",target), rl.SHADER_UNIFORM_VEC3)
93
94 #// Send to shader light color values
95 color = [self.color[0]/255.0, self.color[1]/255.0, self.color[2]/255.0, self.color[3]/255.0]
96 rl.SetShaderValue(self.shader, self.colorLoc, rl.ffi.new("struct Vector4 *",color), rl.SHADER_UNIFORM_VEC4)
97
98
99

Callers 2

configureMethod · 0.95
updateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected