Review and recompile web examples

This commit is contained in:
raysan5 2017-04-17 16:42:01 +02:00
parent 3e082f1d62
commit 881f134f4d
194 changed files with 272938 additions and 52659 deletions

View file

@ -18,9 +18,6 @@
#include "raylib.h"
#include <stdio.h>
#include <stdlib.h>
#if defined(PLATFORM_WEB)
#include <emscripten/emscripten.h>
#endif
@ -31,7 +28,7 @@
int screenWidth = 800;
int screenHeight = 450;
Texture2D sonic;
Texture2D fudesumi;
Shader shader;
//----------------------------------------------------------------------------------
@ -48,7 +45,7 @@ int main()
//--------------------------------------------------------------------------------------
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - shapes and texture shaders");
sonic = LoadTexture("resources/texture_formats/sonic.png");
fudesumi = LoadTexture("resources/fudesumi.png");
// NOTE: Using GLSL 330 shader version, on OpenGL ES 2.0 use GLSL 100 shader version
shader = LoadShader("resources/shaders/glsl100/base.vs",
@ -71,10 +68,10 @@ int main()
// 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;
@ -108,11 +105,11 @@ void UpdateDrawFrame(void)
// Activate our custom shader to be applied on next shapes/textures drawings
BeginShaderMode(shader);
DrawText("USING CUSTOM SHADER", 190, 40, 10, RED);
DrawText("USING CUSTOM SHADER", 190, 40, 10, RED);
DrawRectangle(250 - 60, 90, 120, 60, RED);
DrawRectangleGradient(250 - 90, 170, 180, 130, MAROON, GOLD);
DrawRectangleLines(250 - 40, 320, 80, 60, ORANGE);
DrawRectangle(250 - 60, 90, 120, 60, RED);
DrawRectangleGradient(250 - 90, 170, 180, 130, MAROON, GOLD);
DrawRectangleLines(250 - 40, 320, 80, 60, ORANGE);
// Activate our default shader for next drawings
EndShaderMode();
@ -132,7 +129,7 @@ void UpdateDrawFrame(void)
// 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();