aboutsummaryrefslogtreecommitdiff
path: root/examples/shaders_postprocessing.c
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-05-31 17:11:02 +0200
committerraysan5 <raysan5@gmail.com>2016-05-31 17:11:02 +0200
commitcac2a66debd0f2d3ef8195940f8e2744d539d19a (patch)
tree423a8c52e5eda51008580f9c919a78034766204c /examples/shaders_postprocessing.c
parentcaa7bc366b949310fbb9c7eafbb9fa7050e1514a (diff)
downloadraylib-cac2a66debd0f2d3ef8195940f8e2744d539d19a.tar.gz
raylib-cac2a66debd0f2d3ef8195940f8e2744d539d19a.zip
Improved library consistency
Functions renamed to improve library consistency
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);