This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
neofx-libzoom/light.c

31 lines
420 B
C

#include <stdlib.h>
#include <zoom/light.h>
#include <GL/gl.h>
int nLights = 0;
LIGHT *lights;
COLOR ambient;
void SetAmbient(COLOR c) {
ambient = c;
}
void AddLight(LIGHT light) {
if(nLights == 0)
lights = malloc(sizeof(LIGHT));
else
lights = realloc(lights, sizeof(LIGHT)*(nLights+1));
lights[nLights] = light;
nLights++;
}
void ResetLights() {
if(nLights > 0) {
free(lights);
nLights = 0;
}
}