aboutsummaryrefslogtreecommitdiff
path: root/examples/shaders_postprocessing.c
diff options
context:
space:
mode:
authorJoshua Reisenauer <kd7tck@msn.com>2016-06-01 20:17:39 -0700
committerJoshua Reisenauer <kd7tck@msn.com>2016-06-01 20:17:39 -0700
commitae6adb173b0a89abd5185436029691ae33c1a727 (patch)
tree1e5932f1df42368983844ca16f2c2ddba9cd4b3d /examples/shaders_postprocessing.c
parent90e1ed2b5e54a9b6c69be3dd2b71d1e4f3632c33 (diff)
parent17878550b1e2dde44fcd1e668c92ca2d96680a28 (diff)
downloadraylib-ae6adb173b0a89abd5185436029691ae33c1a727.tar.gz
raylib-ae6adb173b0a89abd5185436029691ae33c1a727.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);