diff options
author | sanine-a <sanine.not@pm.me> | 2020-10-19 05:35:06 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-10-19 05:35:06 -0500 |
commit | 41fa908dc15b522e53946a716f4f6c00520bd46f (patch) | |
tree | bc8176462000b2c77c00d3227037c1acbb13e0ee /src/light | |
parent | 2d046ffd16d8ff3a06f92ca438ca6b2d6842ce6a (diff) |
add honey libraries back and reorganize directories
Diffstat (limited to 'src/light')
-rw-r--r-- | src/light/light.c | 20 | ||||
-rw-r--r-- | src/light/light.h | 33 |
2 files changed, 53 insertions, 0 deletions
diff --git a/src/light/light.c b/src/light/light.c new file mode 100644 index 0000000..839d747 --- /dev/null +++ b/src/light/light.c @@ -0,0 +1,20 @@ +#include "light.h" + +void honey_point_light_new(honey_point_light* light, + float x, float y, float z, + float r, float g, float b, + float constant, + float linear, + float quadratic) { + light->position[0] = x; + light->position[1] = y; + light->position[2] = z; + + light->color[0] = r; + light->color[1] = g; + light->color[2] = b; + + light->constant = constant; + light->linear = linear; + light->quadratic = quadratic; +} diff --git a/src/light/light.h b/src/light/light.h new file mode 100644 index 0000000..dfb6979 --- /dev/null +++ b/src/light/light.h @@ -0,0 +1,33 @@ +#ifndef HONEY_LIGHT_H +#define HONEY_LIGHT_H + +#include "../common.h" + +#define HONEY_MAX_LIGHT_NAME_LENGTH 64 + +typedef struct { + vec3 position; + vec3 color; + + float constant; + float linear; + float quadratic; +} honey_point_light; + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +typedef struct { + vec3 direction; + vec3 color; +} honey_directional_light; + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +void honey_point_light_new(honey_point_light* light, + float x, float y, float z, + float r, float g, float b, + float constant, + float linear, + float quadratic); + +#endif |