diff options
| author | Ray <[email protected]> | 2019-05-17 20:03:04 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2019-05-17 20:03:04 +0200 |
| commit | 245cf2400e3f215b998d4e1f2ae1f9afefa0eb08 (patch) | |
| tree | 15552dd041dab47c9ca23efbb4b8925c384beab2 /examples/models/models_skybox.c | |
| parent | 0ec46e8976f48617fe39bc10a44ff7313d6b27ea (diff) | |
| download | raylib-245cf2400e3f215b998d4e1f2ae1f9afefa0eb08.tar.gz raylib-245cf2400e3f215b998d4e1f2ae1f9afefa0eb08.zip | |
Review shader examples
Diffstat (limited to 'examples/models/models_skybox.c')
| -rw-r--r-- | examples/models/models_skybox.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index 759c79c6..2d4d5710 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -11,6 +11,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 @@ -29,7 +35,9 @@ int main() // Load skybox shader and set required locations // NOTE: Some locations are automatically set at shader loading - skybox.materials[0].shader = LoadShader("resources/shaders/skybox.vs", "resources/shaders/skybox.fs"); + skybox.materials[0].shader = LoadShader(FormatText("resources/shaders/glsl%i/skybox.vs", GLSL_VERSION), + FormatText("resources/shaders/glsl%i/skybox.fs", GLSL_VERSION)); + SetShaderValue(skybox.materials[0].shader, GetShaderLocation(skybox.materials[0].shader, "environmentMap"), (int[1]){ MAP_CUBEMAP }, UNIFORM_INT); // Load cubemap shader and setup required shader locations |
