]>
Dogcows Code - chaz/rasterize/blob - light.h
3 * CS5600 University of Utah
5 * mcgarvey@eng.utah.edu
22 color_t s
; // specular
24 typedef struct light light_t
;
27 * Initialize a light with a position and color.
30 void light_init(light_t
* l
, vec_t position
, color_t diffuse
, color_t specular
)
39 * Create a new light with a position and color.
42 light_t
light_new(vec_t position
, color_t diffuse
, color_t specular
)
45 light_init(&l
, position
, diffuse
, specular
);
51 * Create a new light on the heap.
54 light_t
* light_alloc(vec_t position
, color_t diffuse
, color_t specular
)
56 light_t
* l
= (light_t
*)mem_alloc(sizeof(light_t
));
57 light_init(l
, position
, diffuse
, specular
);
62 light_t
* light_copy(light_t l
)
64 light_t
* n
= (light_t
*)mem_alloc(sizeof(light_t
));
65 memcpy(n
, &l
, sizeof(light_t
));
This page took 0.034732 seconds and 4 git commands to generate.