MCPcopy Index your code
hub / github.com/electronstudio/raylib-python-cffi / __init__

Method __init__

examples/shaders/light_system.py:9–23  ·  view source on GitHub ↗
(self, ambient = [ 0.2, 0.2, 0.2, 1.0 ], *ls)

Source from the content-addressed store, hash-verified

7 lights: list['Light'] = []
8
9 def __init__(self, ambient = [ 0.2, 0.2, 0.2, 1.0 ], *ls):
10 self.shader = rl.LoadShader(b"resources/shaders/fogLight.vs",
11 b"resources/shaders/fogLight.fs");
12
13 #// Get some shader loactions
14 self.shader.locs[rl.SHADER_LOC_MATRIX_MODEL] = rl.GetShaderLocation(self.shader, b"matModel")
15 self.shader.locs[rl.SHADER_LOC_VECTOR_VIEW] = rl.GetShaderLocation(self.shader, b"viewPos")
16
17 #// ambient light level
18 self.ambientLoc = rl.GetShaderLocation(self.shader, b"ambient")
19 v = rl.ffi.new("struct Vector4 *", ambient)
20 rl.SetShaderValue(self.shader, self.ambientLoc, v, rl.SHADER_UNIFORM_VEC4)
21
22 for light in ls:
23 self.add(light)
24
25 def add(self, light):
26 light.configure(len(self.lights), self.shader)

Callers

nothing calls this directly

Calls 1

addMethod · 0.95

Tested by

no test coverage detected