diff options
| author | raysan5 <raysan5@gmail.com> | 2016-05-20 12:28:07 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-05-20 12:28:07 +0200 |
| commit | dcf5f45f687f2a534286aecd5e6471a0440b0c21 (patch) | |
| tree | 42a5028ebab3277a8d46bdcf3fea2990e1aa590d /src/rlgl.h | |
| parent | af890cf21021e4a306bf3f6e4397496b95c1c93a (diff) | |
| download | raylib-dcf5f45f687f2a534286aecd5e6471a0440b0c21.tar.gz raylib-dcf5f45f687f2a534286aecd5e6471a0440b0c21.zip | |
Add lighting system -IN PROGRESS-
Improved materials
Diffstat (limited to 'src/rlgl.h')
| -rw-r--r-- | src/rlgl.h | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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 |
