aboutsummaryrefslogtreecommitdiff
path: root/examples/shaders
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2017-04-14 13:58:39 +0200
committerraysan5 <raysan5@gmail.com>2017-04-14 13:58:39 +0200
commit4315b82ea7b42b68572f14c595aa46f030d82a43 (patch)
tree4a0faa9a4d6c6904ef67b2a21f63234679b7edc1 /examples/shaders
parent82c54449bf4f472d2b46413288c0343e31eae8dc (diff)
downloadraylib-4315b82ea7b42b68572f14c595aa46f030d82a43.tar.gz
raylib-4315b82ea7b42b68572f14c595aa46f030d82a43.zip
Replaced some images and updated examples
Diffstat (limited to 'examples/shaders')
-rw-r--r--examples/shaders/resources/fudesumi.pngbin0 -> 219234 bytes
-rw-r--r--examples/shaders/resources/sonic.pngbin116512 -> 0 bytes
-rw-r--r--examples/shaders/shaders_shapes_textures.c21
-rw-r--r--examples/shaders/shaders_shapes_textures.pngbin110700 -> 167756 bytes
4 files changed, 9 insertions, 12 deletions
diff --git a/examples/shaders/resources/fudesumi.png b/examples/shaders/resources/fudesumi.png
new file mode 100644
index 00000000..8ba983dc
--- /dev/null
+++ b/examples/shaders/resources/fudesumi.png
Binary files differ
diff --git a/examples/shaders/resources/sonic.png b/examples/shaders/resources/sonic.png
deleted file mode 100644
index 7a096847..00000000
--- a/examples/shaders/resources/sonic.png
+++ /dev/null
Binary files differ
diff --git a/examples/shaders/shaders_shapes_textures.c b/examples/shaders/shaders_shapes_textures.c
index 0a14469f..40e99a8f 100644
--- a/examples/shaders/shaders_shapes_textures.c
+++ b/examples/shaders/shaders_shapes_textures.c
@@ -9,7 +9,7 @@
* on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders
* raylib comes with shaders ready for both versions, check raylib/shaders install folder
*
-* This example has been created using raylib 1.3 (www.raylib.com)
+* This example has been created using raylib 1.7 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
@@ -18,9 +18,6 @@
#include "raylib.h"
-#include <stdio.h>
-#include <stdlib.h>
-
int main()
{
// Initialization
@@ -30,14 +27,12 @@ int main()
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - shapes and texture shaders");
- Texture2D sonic = LoadTexture("resources/texture_formats/sonic.png");
+ Texture2D fudesumi = LoadTexture("resources/fudesumi.png");
// NOTE: Using GLSL 330 shader version, on OpenGL ES 2.0 use GLSL 100 shader version
Shader shader = LoadShader("resources/shaders/glsl330/base.vs",
"resources/shaders/glsl330/grayscale.fs");
-
- // Shader usage is also different than models/postprocessing, shader is just activated when required
-
+
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@@ -91,21 +86,23 @@ int main()
// Activate our custom shader to be applied on next shapes/textures drawings
BeginShaderMode(shader);
- DrawTexture(sonic, 380, -10, WHITE); // Using custom shader
+ DrawTexture(fudesumi, 500, -30, WHITE); // Using custom shader
// Activate our default shader for next drawings
EndShaderMode();
+ DrawText("(c) Fudesumi sprite by Eiden Marsal", 380, screenHeight - 20, 10, GRAY);
+
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
- UnloadShader(shader); // Unload shader
- UnloadTexture(sonic); // Unload texture
+ UnloadShader(shader); // Unload shader
+ UnloadTexture(fudesumi); // Unload texture
- CloseWindow(); // Close window and OpenGL context
+ CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
diff --git a/examples/shaders/shaders_shapes_textures.png b/examples/shaders/shaders_shapes_textures.png
index ee5fed42..63a2283c 100644
--- a/examples/shaders/shaders_shapes_textures.png
+++ b/examples/shaders/shaders_shapes_textures.png
Binary files differ