diff options
| author | Ray <[email protected]> | 2018-12-18 17:22:13 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2018-12-18 17:22:13 +0100 |
| commit | 8f95518858545ffb9c9ddc49bbb638385cb37503 (patch) | |
| tree | a036fb3e20ce9dd994e46f6cb4bf1a2b2460eac1 /examples/shaders/shaders_custom_uniform.c | |
| parent | db96cf4a8ba87f10c3f0bb1043f846f2233dba03 (diff) | |
| download | raylib-8f95518858545ffb9c9ddc49bbb638385cb37503.tar.gz raylib-8f95518858545ffb9c9ddc49bbb638385cb37503.zip | |
Reviewed some examples to work on RPI
Diffstat (limited to 'examples/shaders/shaders_custom_uniform.c')
| -rw-r--r-- | examples/shaders/shaders_custom_uniform.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/examples/shaders/shaders_custom_uniform.c b/examples/shaders/shaders_custom_uniform.c index f898ac78..de76a376 100644 --- a/examples/shaders/shaders_custom_uniform.c +++ b/examples/shaders/shaders_custom_uniform.c @@ -18,6 +18,12 @@ #include "raylib.h" +#if defined(PLATFORM_DESKTOP) + #define GLSL_VERSION 330 +#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB + #define GLSL_VERSION 100 +#endif + int main() { // Initialization @@ -41,10 +47,11 @@ int main() Texture2D texture = LoadTexture("resources/models/barracks_diffuse.png"); // Load model texture (diffuse map) model.material.maps[MAP_DIFFUSE].texture = texture; // Set model diffuse texture - Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position + Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position - Shader shader = LoadShader("resources/shaders/glsl330/base.vs", - "resources/shaders/glsl330/swirl.fs"); // Load postpro shader + // Load postprocessing shader + // NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader + Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/swirl.fs", GLSL_VERSION)); // Get variable (uniform) location on the shader to connect with the program // NOTE: If uniform variable could not be found in the shader, function returns -1 |
