32 lines
439 B
C
32 lines
439 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;
|
|
UpdateAmbient();
|
|
}
|
|
}
|