mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Review and recompile web examples
This commit is contained in:
BIN
docs/examples/web/shaders/resources/fudesumi.png
Normal file
BIN
docs/examples/web/shaders/resources/fudesumi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 214 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 114 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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();
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 215 KiB |
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user