aboutsummaryrefslogtreecommitdiff
path: root/src/raylib.h
diff options
context:
space:
mode:
authorJoshua Reisenauer <kd7tck@msn.com>2016-05-10 02:00:42 -0700
committerJoshua Reisenauer <kd7tck@msn.com>2016-05-10 02:00:42 -0700
commit9799856ad4864b808cbfb40b0b4398fcdf61c1c2 (patch)
tree05e311a651b3c41d333810b7b9c9408cd5918eb7 /src/raylib.h
parentb7f8e97b0384ae37bff110a2ef42cc42cfa09228 (diff)
parentac44db26a2a2bed901c7e75d96e215fa09bd3705 (diff)
downloadraylib-9799856ad4864b808cbfb40b0b4398fcdf61c1c2.tar.gz
raylib-9799856ad4864b808cbfb40b0b4398fcdf61c1c2.zip
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'src/raylib.h')
-rw-r--r--src/raylib.h47
1 files changed, 26 insertions, 21 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 63ab0a5c..d464c8e9 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -369,12 +369,12 @@ typedef struct BoundingBox {
// Vertex data definning a mesh
typedef struct Mesh {
int vertexCount; // num vertices
- float *vertices; // vertex position (XYZ - 3 components per vertex)
- float *texcoords; // vertex texture coordinates (UV - 2 components per vertex)
- float *texcoords2; // vertex second texture coordinates (useful for lightmaps)
- float *normals; // vertex normals (XYZ - 3 components per vertex)
- float *tangents; // vertex tangents (XYZ - 3 components per vertex)
- unsigned char *colors; // vertex colors (RGBA - 4 components per vertex)
+ float *vertices; // vertex position (XYZ - 3 components per vertex) (shader-location = 0)
+ float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
+ float *texcoords2; // vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
+ float *normals; // vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
+ float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4)
+ unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
BoundingBox bounds; // mesh limits defined by min and max points
@@ -386,11 +386,13 @@ typedef struct Mesh {
typedef struct Shader {
unsigned int id; // Shader program id
- // Variable attributes locations
- int vertexLoc; // Vertex attribute location point (vertex shader)
- int texcoordLoc; // Texcoord attribute location point (vertex shader)
- int normalLoc; // Normal attribute location point (vertex shader)
- int colorLoc; // Color attibute location point (vertex shader)
+ // Vertex attributes locations (default locations)
+ int vertexLoc; // Vertex attribute location point (default-location = 0)
+ int texcoordLoc; // Texcoord attribute location point (default-location = 1)
+ int normalLoc; // Normal attribute location point (default-location = 2)
+ int colorLoc; // Color attibute location point (default-location = 3)
+ int tangentLoc; // Tangent attribute location point (default-location = 4)
+ int texcoord2Loc; // Texcoord2 attribute location point (default-location = 5)
// Uniform locations
int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader)
@@ -801,17 +803,20 @@ void DrawGizmo(Vector3 position);
//------------------------------------------------------------------------------------
// Model 3d Loading and Drawing Functions (Module: models)
//------------------------------------------------------------------------------------
-Model LoadModel(const char *fileName); // Load a 3d model (.OBJ)
-Model LoadModelEx(Mesh data); // Load a 3d model (from mesh data)
-//Model LoadModelFromRES(const char *rresName, int resId); // TODO: Load a 3d model from rRES file (raylib Resource)
-Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model
-Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based)
-void UnloadModel(Model model); // Unload 3d model from memory
-void SetModelTexture(Model *model, Texture2D texture); // Link a texture to a model
+Model LoadModel(const char *fileName); // Load a 3d model (.OBJ)
+Model LoadModelEx(Mesh data); // Load a 3d model (from mesh data)
+Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d model from rRES file (raylib Resource)
+Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model
+Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based)
+void UnloadModel(Model model); // Unload 3d model from memory
+void SetModelTexture(Model *model, Texture2D texture); // Link a texture to a model
+
+Material LoadMaterial(const char *fileName); // Load material data (from file)
+Material LoadDefaultMaterial(void); // Load default material (uses default models shader)
void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters
-void DrawModelWires(Model model, Vector3 position, float scale, Color color); // Draw a model wires (with texture if set)
+void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters
void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
@@ -832,11 +837,11 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p
// NOTE: This functions are useless when using OpenGL 1.1
//------------------------------------------------------------------------------------
Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations
-unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr); // Load custom shaders strings and return program id
void UnloadShader(Shader shader); // Unload a custom shader from memory
void SetDefaultShader(void); // Set default shader to be used in batch draw
void SetCustomShader(Shader shader); // Set custom shader to be used in batch draw
-void SetModelShader(Model *model, Shader shader); // Link a shader to a model
+Shader GetDefaultShader(void); // Get default shader
+Texture2D GetDefaultTexture(void); // Get default texture
int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float)