99c0d7c3abfa1aee87c0911066e4f142c0eb3302
[chaz/rasterize] / light.h
1
2 /*
3 * CS5600 University of Utah
4 * Charles McGarvey
5 * mcgarvey@eng.utah.edu
6 */
7
8 #ifndef _LIGHT_H_
9 #define _LIGHT_H_
10
11 #include "color.h"
12 #include "vec.h"
13
14
15 /*
16 * A light source.
17 */
18 struct light
19 {
20 color_t color;
21 vec_t position;
22 };
23 typedef struct light light_t;
24
25
26 /*
27 * Initialize a light with a color and position.
28 */
29 INLINE_MAYBE
30 void light_init(light_t* l, color_t color, vec_t position)
31 {
32 l->color = color;
33 l->position = position;
34 }
35
36
37 /*
38 * Create a new light with a color and position.
39 */
40 INLINE_MAYBE
41 light_t light_new(color_t color, vec_t position)
42 {
43 light_t l;
44 light_init(&l, color, position);
45 return l;
46 }
47
48
49 #endif // _LIGHT_H_
50
This page took 0.039127 seconds and 3 git commands to generate.