aboutsummaryrefslogtreecommitdiff
path: root/examples/shaders_postprocessing.c
diff options
context:
space:
mode:
authorvictorfisac <victorfisac@gmail.com>2016-06-07 23:41:34 +0200
committervictorfisac <victorfisac@gmail.com>2016-06-07 23:41:34 +0200
commitf97f39987c1b35205eb6824d017a1c288ce64a2d (patch)
tree843d8839997deb76b541579b0aa6591a6753108d /examples/shaders_postprocessing.c
parent11cf455fe0d2c956043aa70f7d8256c4a339b430 (diff)
parent5631f822bd9195d494915d3b2bb80caf47a65068 (diff)
downloadraylib-f97f39987c1b35205eb6824d017a1c288ce64a2d.tar.gz
raylib-f97f39987c1b35205eb6824d017a1c288ce64a2d.zip
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'examples/shaders_postprocessing.c')
-rw-r--r--examples/shaders_postprocessing.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/shaders_postprocessing.c b/examples/shaders_postprocessing.c
index e9fafe15..5e8b5a80 100644
--- a/examples/shaders_postprocessing.c
+++ b/examples/shaders_postprocessing.c
@@ -33,7 +33,7 @@ int main()
Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model
- Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture
+ Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map)
SetModelTexture(&dwarf, texture); // Bind texture to model
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
@@ -80,10 +80,12 @@ int main()
EndTextureMode(); // End drawing to texture (now we have a texture available for next passes)
- SetCustomShader(shader);
- // NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom)
- DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE);
- SetDefaultShader();
+ BeginShaderMode(shader);
+
+ // NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom)
+ DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE);
+
+ EndShaderMode();
DrawText("(c) Dwarf 3D model by David Moreno", screenWidth - 200, screenHeight - 20, 10, DARKGRAY);