diff options
| author | victorfisac <[email protected]> | 2017-05-02 14:18:11 +0200 |
|---|---|---|
| committer | victorfisac <[email protected]> | 2017-05-02 14:18:11 +0200 |
| commit | db0cfa935f52a2557e6e3dfddab341917cb1eb14 (patch) | |
| tree | 15e9782c639571d57030420f69c6b8f7c4a69f50 /docs/examples/src/shaders | |
| parent | 8849a4c7526ee6a321df9393dd69d0b29820311a (diff) | |
| parent | d593bd0081ea2dcafe3182ffc874882b5b7110b4 (diff) | |
| download | raylib-db0cfa935f52a2557e6e3dfddab341917cb1eb14.tar.gz raylib-db0cfa935f52a2557e6e3dfddab341917cb1eb14.zip | |
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'docs/examples/src/shaders')
| -rw-r--r-- | docs/examples/src/shaders/shaders_shapes_textures.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/docs/examples/src/shaders/shaders_shapes_textures.c b/docs/examples/src/shaders/shaders_shapes_textures.c index 0a14469f..40e99a8f 100644 --- a/docs/examples/src/shaders/shaders_shapes_textures.c +++ b/docs/examples/src/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; |
