CreateLight method
Implementation
LightC CreateLight(
int type,
Vector3C position,
Vector3C target,
ColorC color,
ShaderC shader,
) {
final light = calloc<LightC>();
light.ref.enabled = true;
light.ref.type = type;
light.ref.position.setC(position);
light.ref.target.setC(target);
light.ref.color.setC(color);
int index = _lights.length;
light.ref.enabledLoc = rl.Core.GetShaderLocation(
shader, rl.Temp.str("lights[$index].enabled"),
);
light.ref.typeLoc = rl.Core.GetShaderLocation(
shader, rl.Temp.str("lights[$index].type"),
);
light.ref.positionLoc = rl.Core.GetShaderLocation(
shader, rl.Temp.str("lights[$index].position"),
);
light.ref.targetLoc = rl.Core.GetShaderLocation(
shader, rl.Temp.str("lights[$index].target"),
);
light.ref.colorLoc = rl.Core.GetShaderLocation(
shader, rl.Temp.str("lights[$index].color"),
);
UpdateLightValues(shader, light.ref);
_lights.add(light);
return light.ref;
}