diff options
| author | Leandro Gabriel <45115495+VelocityIsNotSpeed@users.noreply.github.com> | 2019-08-03 06:07:41 -0300 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2019-08-03 11:07:41 +0200 |
| commit | 89c16baf182aed201b75b99a253c0b074ffffeed (patch) | |
| tree | 90edca66ea7b4c9c83aab26daa2496b770206ab5 /examples/shaders | |
| parent | 68ffbc06c74b717946d1bcb3a7e433d5fb859c85 (diff) | |
| download | raylib-89c16baf182aed201b75b99a253c0b074ffffeed.tar.gz raylib-89c16baf182aed201b75b99a253c0b074ffffeed.zip | |
Replace tabs with spaces and update year of copyright notices (#927)
* Update year of copyright notices
* Fix mistake in comment
* Fix typo ("algorythms")
* Replace tabs with spaces
* Remove trailing whitespace and fix mistake in comment
* Fix ExportImageAsCode missing comment rectangle corner
* Replace tab with spaces
* Replace tabs with spaces
Diffstat (limited to 'examples/shaders')
| -rw-r--r-- | examples/shaders/shaders_texture_waves.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/examples/shaders/shaders_texture_waves.c b/examples/shaders/shaders_texture_waves.c index 07186d37..c0450361 100644 --- a/examples/shaders/shaders_texture_waves.c +++ b/examples/shaders/shaders_texture_waves.c @@ -33,38 +33,38 @@ int main(void) const int screenWidth = 800; const int screenHeight = 450; - InitWindow(screenWidth, screenHeight, "raylib [shaders] example - texture waves"); - + InitWindow(screenWidth, screenHeight, "raylib [shaders] example - texture waves"); + // Load texture texture to apply shaders - Texture2D texture = LoadTexture("resources/space.png"); - + Texture2D texture = LoadTexture("resources/space.png"); + // Load shader and setup location points and values Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/wave.fs", GLSL_VERSION)); - int secondsLoc = GetShaderLocation(shader, "secondes"); - int freqXLoc = GetShaderLocation(shader, "freqX"); - int freqYLoc = GetShaderLocation(shader, "freqY"); - int ampXLoc = GetShaderLocation(shader, "ampX"); - int ampYLoc = GetShaderLocation(shader, "ampY"); - int speedXLoc = GetShaderLocation(shader, "speedX"); - int speedYLoc = GetShaderLocation(shader, "speedY"); + int secondsLoc = GetShaderLocation(shader, "secondes"); + int freqXLoc = GetShaderLocation(shader, "freqX"); + int freqYLoc = GetShaderLocation(shader, "freqY"); + int ampXLoc = GetShaderLocation(shader, "ampX"); + int ampYLoc = GetShaderLocation(shader, "ampY"); + int speedXLoc = GetShaderLocation(shader, "speedX"); + int speedYLoc = GetShaderLocation(shader, "speedY"); // Shader uniform values that can be updated at any time - float freqX = 25.0f; - float freqY = 25.0f; - float ampX = 5.0f; - float ampY = 5.0f; - float speedX = 8.0f; - float speedY = 8.0f; + float freqX = 25.0f; + float freqY = 25.0f; + float ampX = 5.0f; + float ampY = 5.0f; + float speedX = 8.0f; + float speedY = 8.0f; float screenSize[2] = { (float)GetScreenWidth(), (float)GetScreenHeight() }; - SetShaderValue(shader, GetShaderLocation(shader, "size"), &screenSize, UNIFORM_VEC2); - SetShaderValue(shader, freqXLoc, &freqX, UNIFORM_FLOAT); - SetShaderValue(shader, freqYLoc, &freqY, UNIFORM_FLOAT); - SetShaderValue(shader, ampXLoc, &X, UNIFORM_FLOAT); - SetShaderValue(shader, ampYLoc, &Y, UNIFORM_FLOAT); - SetShaderValue(shader, speedXLoc, &speedX, UNIFORM_FLOAT); - SetShaderValue(shader, speedYLoc, &speedY, UNIFORM_FLOAT); + SetShaderValue(shader, GetShaderLocation(shader, "size"), &screenSize, UNIFORM_VEC2); + SetShaderValue(shader, freqXLoc, &freqX, UNIFORM_FLOAT); + SetShaderValue(shader, freqYLoc, &freqY, UNIFORM_FLOAT); + SetShaderValue(shader, ampXLoc, &X, UNIFORM_FLOAT); + SetShaderValue(shader, ampYLoc, &Y, UNIFORM_FLOAT); + SetShaderValue(shader, speedXLoc, &speedX, UNIFORM_FLOAT); + SetShaderValue(shader, speedYLoc, &speedY, UNIFORM_FLOAT); float seconds = 0.0f; @@ -76,9 +76,9 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - seconds += GetFrameTime(); + seconds += GetFrameTime(); - SetShaderValue(shader, secondsLoc, &seconds, UNIFORM_FLOAT); + SetShaderValue(shader, secondsLoc, &seconds, UNIFORM_FLOAT); //---------------------------------------------------------------------------------- // Draw @@ -87,12 +87,12 @@ int main(void) ClearBackground(RAYWHITE); - BeginShaderMode(shader); + BeginShaderMode(shader); - DrawTexture(texture, 0, 0, WHITE); - DrawTexture(texture, texture.width, 0, WHITE); + DrawTexture(texture, 0, 0, WHITE); + DrawTexture(texture, texture.width, 0, WHITE); - EndShaderMode(); + EndShaderMode(); EndDrawing(); //---------------------------------------------------------------------------------- |
