aboutsummaryrefslogtreecommitdiff
path: root/src/raylib.h
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2015-02-02 00:57:08 +0100
committerraysan5 <raysan5@gmail.com>2015-02-02 00:57:08 +0100
commit42c92e4f2e2f12589434b91861fd98d11125e449 (patch)
tree3e03553cc9e512dac4f5011128a045edbb92c24a /src/raylib.h
parentb9e53cd1352e6a8d2f282b29cdab2828a40dfd33 (diff)
downloadraylib-42c92e4f2e2f12589434b91861fd98d11125e449.tar.gz
raylib-42c92e4f2e2f12589434b91861fd98d11125e449.zip
Add support for custom shaders
Custom shaders for models Postprocessig on FBO (in progress) Some useless spaces removed
Diffstat (limited to 'src/raylib.h')
-rw-r--r--src/raylib.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/raylib.h b/src/raylib.h
index ef487a30..3c849bdd 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -92,7 +92,7 @@
#define FLAG_MSAA_4X_HINT 16
#define FLAG_VSYNC_HINT 32
-// Keyboard Function Keys
+// Keyboard Function Keys
#define KEY_SPACE 32
#define KEY_ESCAPE 256
#define KEY_ENTER 257
@@ -268,9 +268,15 @@ typedef struct Model {
unsigned int vaoId;
unsigned int vboId[4];
unsigned int textureId;
+ unsigned int shaderId;
//Matrix transform;
} Model;
+// Shader type
+typedef struct Shader {
+ unsigned int id;
+} Shader;
+
// Sound source type
typedef struct Sound {
unsigned int source;
@@ -334,6 +340,9 @@ Color Fade(Color color, float alpha); // Color fade-in or
void SetupFlags(char flags); // Enable some window configurations
void ShowLogo(void); // Activates raylib logo at startup (can be done with flags)
+void InitPostShader(void);
+void SetPostShader(unsigned int shader);
+
//------------------------------------------------------------------------------------
// Input Handling Functions (Module: core)
//------------------------------------------------------------------------------------
@@ -449,7 +458,7 @@ void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color
void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires
void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone
void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires
-void DrawQuad(Vector3 vertices[4], Vector2 textcoords[4], Vector3 normals[4], Color colors[4]); // Draw a quad
+void DrawQuad(Vector3 vertices[4], Vector2 textcoords[4], Vector3 normals[4], Color colors[4]); // Draw a quad
void DrawPlane(Vector3 centerPos, Vector2 size, Vector3 rotation, Color color); // Draw a plane
void DrawPlaneEx(Vector3 centerPos, Vector2 size, Vector3 rotation, int slicesX, int slicesZ, Color color); // Draw a plane with divisions
void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0))
@@ -466,6 +475,7 @@ Model LoadHeightmap(Image heightmap, float maxHeight);
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
+void SetModelShader(Model *model, unsigned int 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 rotation, Vector3 scale, Color tint); // Draw a model with extended parameters
@@ -474,6 +484,8 @@ void DrawModelWires(Model model, Vector3 position, float scale, Color color);
void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture
void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec
+unsigned int LoadCustomShader(char *vsFileName, char *fsFileName); // Load a custom shader (vertex shader + fragment shader)
+
//------------------------------------------------------------------------------------
// Audio Loading and Playing Functions (Module: audio)
//------------------------------------------------------------------------------------