summaryrefslogtreecommitdiffstats
path: root/light.c
blob: 5fa98f639d25fd4b68ed7aa2def73fa4f1947cba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#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;
	}
}