aboutsummaryrefslogtreecommitdiff
path: root/src/rlgl.h
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-05-20 12:28:07 +0200
committerraysan5 <raysan5@gmail.com>2016-05-20 12:28:07 +0200
commitdcf5f45f687f2a534286aecd5e6471a0440b0c21 (patch)
tree42a5028ebab3277a8d46bdcf3fea2990e1aa590d /src/rlgl.h
parentaf890cf21021e4a306bf3f6e4397496b95c1c93a (diff)
downloadraylib-dcf5f45f687f2a534286aecd5e6471a0440b0c21.tar.gz
raylib-dcf5f45f687f2a534286aecd5e6471a0440b0c21.zip
Add lighting system -IN PROGRESS-
Improved materials
Diffstat (limited to 'src/rlgl.h')
-rw-r--r--src/rlgl.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index a557ffa2..39941b33 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -209,6 +209,28 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion;
float glossiness;
float normalDepth;
} Material;
+
+ // Light type
+ // TODO: Review contained data to support different light types and features
+ typedef struct LightData {
+ int id;
+ int type; // LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT
+ bool enabled;
+
+ Vector3 position;
+ Vector3 direction; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction)
+ float attenuation; // Lost of light intensity with distance (use radius?)
+
+ Color diffuse; // Use Vector3 diffuse (including intensities)?
+ float intensity;
+
+ Color specular;
+ //float specFactor; // Specular intensity ?
+
+ //Color ambient; // Required?
+
+ float coneAngle; // SpotLight
+ } LightData, *Light;
// Color blending modes (pre-defined)
typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode;
@@ -311,6 +333,9 @@ void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // S
void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4)
void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied)
+
+Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool
+void DestroyLight(Light light); // Destroy a light and take it out of the list
#endif
#ifdef __cplusplus