LibGame  v0.4.0
The LG Game Engine - Copyright (C) 2024 ETMSoftware
lg_light.h
1 /*
2  * LibGame - Copyright (C) Emmanuel Thomas-Maurin 2011-2024
3  * All rights reserved
4  */
5 
6 #ifndef LG_LIGHT_H
7 #define LG_LIGHT_H
8 
9 typedef enum {
10  POINT,
11  DIRECTIONAL,
12  SPOTLIGHT,
13  AMBIENT,
14  DIFFUSE,
15  EMISSIVE,
16  SPECULAR
17 } lg_light_type;
18 
19 #define WHITE_LIGHT (LG_Color_f){1.0, 1.0, 1.0, 1.0}
20 
21 /*
22  * LG_Light struct
23  *
24  * Use an array of LG_Light structs if you want to have several different lights in a scene
25  */
26 typedef struct {
27  lg_light_type type;
28  union {
29  vec3_t pos;
30  vec3_t dir;
31  };
32  LG_Color_f color;
33 } LG_Light;
34 
35 LG_Light lg_light(lg_light_type, vec3_t, LG_Color_f);
36 
38 
40 
42 
44 
46 
47 void lg_change_light_dir(LG_Light *, LG_EulerAng, const char *);
48 
49 #endif /* LG_LIGHT_H */
lg_change_light_dir
void lg_change_light_dir(LG_Light *light, LG_EulerAng angle, const char *rot_order)
Definition: lg_light.c:115
LG_EulerAng
Definition: lg_quaternions.h:16
LG_Light
Definition: lg_light.h:26
lg_light
LG_Light lg_light(lg_light_type type, vec3_t pos_or_dir, LG_Color_f color)
Definition: lg_light.c:27
lg_move_light_src
void lg_move_light_src(LG_Light *light, vec3_t delta)
Definition: lg_light.c:72
lg_set_light_src
void lg_set_light_src(LG_Light *light, vec3_t pos)
Definition: lg_light.c:44
vec3_t
Definition: math_3d.h:111
LG_Color_f
Definition: lg_vertex.h:99
lg_get_light_src
vec3_t lg_get_light_src(LG_Light *light)
Definition: lg_light.c:58
lg_get_light_dir
vec3_t lg_get_light_dir(LG_Light *light)
Definition: lg_light.c:100
lg_set_light_dir
void lg_set_light_dir(LG_Light *light, vec3_t dir)
Definition: lg_light.c:86