summaryrefslogtreecommitdiffhomepage
path: root/examples/shaders
diff options
context:
space:
mode:
authorAsdqwe <[email protected]>2023-08-30 17:42:01 -0300
committerGitHub <[email protected]>2023-08-30 22:42:01 +0200
commit3d0d54e0708a71ad40bec3f312ebf26d5fc2a28f (patch)
treea7eaffe0339859610a403a0b1979baf1c25ebb04 /examples/shaders
parentfefe8fcda96db357ab4b93490d0453f4b3058cc6 (diff)
downloadraylib-3d0d54e0708a71ad40bec3f312ebf26d5fc2a28f.tar.gz
raylib-3d0d54e0708a71ad40bec3f312ebf26d5fc2a28f.zip
Fix examples/shaders/shaders_texture_outline.c help instructions (#3278)
Diffstat (limited to 'examples/shaders')
-rw-r--r--examples/shaders/shaders_texture_outline.c18
-rw-r--r--examples/shaders/shaders_texture_outline.pngbin264137 -> 264739 bytes
2 files changed, 9 insertions, 9 deletions
diff --git a/examples/shaders/shaders_texture_outline.c b/examples/shaders/shaders_texture_outline.c
index a28ab80e..09f625bb 100644
--- a/examples/shaders/shaders_texture_outline.c
+++ b/examples/shaders/shaders_texture_outline.c
@@ -37,18 +37,18 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - Apply an outline to a texture");
Texture2D texture = LoadTexture("resources/fudesumi.png");
-
+
Shader shdrOutline = LoadShader(0, TextFormat("resources/shaders/glsl%i/outline.fs", GLSL_VERSION));
float outlineSize = 2.0f;
- float outlineColor[4] = { 1.0f, 0.0f, 0.0f, 1.0f }; // Normalized RED color
+ float outlineColor[4] = { 1.0f, 0.0f, 0.0f, 1.0f }; // Normalized RED color
float textureSize[2] = { (float)texture.width, (float)texture.height };
-
+
// Get shader locations
int outlineSizeLoc = GetShaderLocation(shdrOutline, "outlineSize");
int outlineColorLoc = GetShaderLocation(shdrOutline, "outlineColor");
int textureSizeLoc = GetShaderLocation(shdrOutline, "textureSize");
-
+
// Set shader values (they can be changed later)
SetShaderValue(shdrOutline, outlineSizeLoc, &outlineSize, SHADER_UNIFORM_FLOAT);
SetShaderValue(shdrOutline, outlineColorLoc, outlineColor, SHADER_UNIFORM_VEC4);
@@ -64,7 +64,7 @@ int main(void)
//----------------------------------------------------------------------------------
outlineSize += GetMouseWheelMove();
if (outlineSize < 1.0f) outlineSize = 1.0f;
-
+
SetShaderValue(shdrOutline, outlineSizeLoc, &outlineSize, SHADER_UNIFORM_FLOAT);
//----------------------------------------------------------------------------------
@@ -75,13 +75,13 @@ int main(void)
ClearBackground(RAYWHITE);
BeginShaderMode(shdrOutline);
-
+
DrawTexture(texture, GetScreenWidth()/2 - texture.width/2, -30, WHITE);
-
+
EndShaderMode();
DrawText("Shader-based\ntexture\noutline", 10, 10, 20, GRAY);
-
+ DrawText("Scroll mouse wheel to\nchange outline size", 10, 72, 20, GRAY);
DrawText(TextFormat("Outline size: %i px", (int)outlineSize), 10, 120, 20, MAROON);
DrawFPS(710, 10);
@@ -99,4 +99,4 @@ int main(void)
//--------------------------------------------------------------------------------------
return 0;
-} \ No newline at end of file
+}
diff --git a/examples/shaders/shaders_texture_outline.png b/examples/shaders/shaders_texture_outline.png
index 85c69b18..badd388a 100644
--- a/examples/shaders/shaders_texture_outline.png
+++ b/examples/shaders/shaders_texture_outline.png
Binary files differ