LibGame v0.4.0
The LG Game Engine - Copyright (C) 2024-2026 ETMSoftware
Loading...
Searching...
No Matches
lg_light.h
1/*
2 * LibGame - Copyright (C) Emmanuel Thomas-Maurin 2011-2026
3 * All rights reserved
4 */
5
6#ifndef LG_LIGHT_H
7#define LG_LIGHT_H
8
9typedef 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 */
26typedef struct {
27 lg_light_type type;
28 union { // === NOT SURE THIS IS OK ===
29 vec3_t pos;
30 vec3_t dir;
31 };
32 LG_Color_f color;
33} LG_Light;
34
35LG_Light lg_light(lg_light_type, vec3_t, LG_Color_f);
36
38
40
42
44
46
47void lg_change_light_dir(LG_Light *, LG_EulerAng, const char *);
48
49#endif /* LG_LIGHT_H */
vec3_t lg_get_light_dir(LG_Light *light)
Definition lg_light.c:183
void lg_set_light_src(LG_Light *light, vec3_t pos)
Definition lg_light.c:124
void lg_set_light_dir(LG_Light *light, vec3_t dir)
Definition lg_light.c:168
LG_Light lg_light(lg_light_type type, vec3_t pos_or_dir, LG_Color_f color)
Definition lg_light.c:107
void lg_change_light_dir(LG_Light *light, LG_EulerAng angle, const char *rot_order)
Definition lg_light.c:198
void lg_move_light_src(LG_Light *light, vec3_t delta)
Definition lg_light.c:153
vec3_t lg_get_light_src(LG_Light *light)
Definition lg_light.c:139
Definition lg_vertex.h:119
Definition lg_quaternions.h:26
Definition lg_light.h:26
Definition math_3d.h:123