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
This commit is contained in:
parent
68ffbc06c7
commit
89c16baf18
25 changed files with 791 additions and 790 deletions
|
@ -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();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue