aboutsummaryrefslogtreecommitdiff
path: root/src/rlgl.h
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-03-06 02:05:16 +0100
committerraysan5 <raysan5@gmail.com>2016-03-06 02:05:16 +0100
commitc9d22c7a14a84b24a94f876c9e438c621b4bf420 (patch)
treeabf4f2ec17f6773207dd7f2487c7a6cafbee2445 /src/rlgl.h
parent893facdf6d81a430f5291407afac0e70627d0f0d (diff)
downloadraylib-c9d22c7a14a84b24a94f876c9e438c621b4bf420.tar.gz
raylib-c9d22c7a14a84b24a94f876c9e438c621b4bf420.zip
Redesign to use Material type -IN PROGRESS-
Requires Shader access functions review
Diffstat (limited to 'src/rlgl.h')
-rw-r--r--src/rlgl.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 9e0aaaaa..69640feb 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -154,11 +154,6 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion;
typedef struct Shader {
unsigned int id; // Shader program id
- // TODO: This should be Texture2D objects
- unsigned int texDiffuseId; // Diffuse texture id
- unsigned int texNormalId; // Normal texture id
- unsigned int texSpecularId; // Specular texture id
-
// Variable attributes
int vertexLoc; // Vertex attribute location point (vertex shader)
int texcoordLoc; // Texcoord attribute location point (vertex shader)
@@ -184,12 +179,27 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion;
int format; // Data format (TextureFormat)
} Texture2D;
+ // Material type
+ typedef struct Material {
+ Shader shader;
+
+ Texture2D texDiffuse; // Diffuse texture
+ Texture2D texNormal; // Normal texture
+ Texture2D texSpecular; // Specular texture
+
+ Color colDiffuse;
+ Color colAmbient;
+ Color colSpecular;
+
+ float glossiness;
+ float normalDepth;
+ } Material;
+
// 3d Model type
typedef struct Model {
Mesh mesh;
Matrix transform;
- Texture2D texture;
- Shader shader;
+ Material material;
} Model;
// Color blending modes (pre-defined)