2021-11-30 21:29:18 -06:00
|
|
|
#ifndef LIGHT_H
|
|
|
|
#define LIGHT_H
|
|
|
|
|
2022-02-06 10:14:57 -06:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2021-11-30 21:29:18 -06:00
|
|
|
struct mLight {
|
2022-02-06 10:14:57 -06:00
|
|
|
struct mGameObject *go;
|
|
|
|
uint8_t color[3];
|
2021-11-30 21:29:18 -06:00
|
|
|
float strength;
|
|
|
|
int dynamic;
|
|
|
|
int on;
|
|
|
|
};
|
|
|
|
|
2022-02-06 10:14:57 -06:00
|
|
|
/*
|
2021-11-30 21:29:18 -06:00
|
|
|
struct mPointLight {
|
|
|
|
struct mLight light;
|
|
|
|
float constant;
|
|
|
|
float linear;
|
|
|
|
float quadratic;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct mPointLight *MakePointlight();
|
|
|
|
void pointlight_prepshader(struct mPointLight *light,
|
|
|
|
struct mShader *shader, int num);
|
|
|
|
void pointlights_prepshader(struct mShader *shader);
|
|
|
|
|
|
|
|
|
|
|
|
struct mSpotLight {
|
|
|
|
struct mLight light;
|
|
|
|
float constant;
|
|
|
|
float linear;
|
|
|
|
float quadratic;
|
|
|
|
float distance;
|
|
|
|
|
|
|
|
float cutoff;
|
|
|
|
float outerCutoff;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct mSpotLight *MakeSpotlight();
|
|
|
|
void spotlight_gui(struct mSpotLight *light);
|
|
|
|
void spotlight_prepshader(struct mSpotLight *light, struct mShader *shader,
|
|
|
|
int num);
|
|
|
|
void spotlights_prepshader(struct mShader *shader);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct mDirectionalLight {
|
|
|
|
struct mLight light;
|
|
|
|
};
|
|
|
|
|
|
|
|
void dlight_prepshader(struct mDirectionalLight *light,
|
|
|
|
struct mShader *shader);
|
|
|
|
struct mDirectionalLight *MakeDLight();
|
|
|
|
|
|
|
|
extern struct mDirectionalLight *dLight;
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2022-08-12 14:03:56 -05:00
|
|
|
void light_gui(struct mLight *light);
|
|
|
|
void pointlight_gui(struct mPointLight *light);
|
|
|
|
void spotlight_gui(struct mSpotLight *spot);
|
|
|
|
|
2021-11-30 21:29:18 -06:00
|
|
|
#endif
|