summaryrefslogtreecommitdiffhomepage
path: root/examples/shaders
diff options
context:
space:
mode:
authorJeffery Myers <[email protected]>2021-03-22 23:51:52 -0700
committerGitHub <[email protected]>2021-03-23 07:51:52 +0100
commite48b9a6da1d3dd6163b1596e47c58e7026530dc1 (patch)
tree9d1bca87d19ae07f7605c112c53971531b109dc2 /examples/shaders
parentc6dd41495b2c0d96cf4d1ca108729ec87c9a0b53 (diff)
downloadraylib-e48b9a6da1d3dd6163b1596e47c58e7026530dc1.tar.gz
raylib-e48b9a6da1d3dd6163b1596e47c58e7026530dc1.zip
[Examples] Warning fixes (pt 1) (#1668)
* Fix some warnings in examples. * cleanups from review Co-authored-by: Jeffery Myers <[email protected]>
Diffstat (limited to 'examples/shaders')
-rw-r--r--examples/shaders/shaders_postprocessing.c2
-rw-r--r--examples/shaders/shaders_rlgl_mesh_instanced.c12
-rw-r--r--examples/shaders/shaders_simple_mask.c4
-rw-r--r--examples/shaders/shaders_texture_drawing.c2
4 files changed, 10 insertions, 10 deletions
diff --git a/examples/shaders/shaders_postprocessing.c b/examples/shaders/shaders_postprocessing.c
index 044e4fb3..ef815391 100644
--- a/examples/shaders/shaders_postprocessing.c
+++ b/examples/shaders/shaders_postprocessing.c
@@ -146,7 +146,7 @@ int main(void)
BeginShaderMode(shaders[currentShader]);
// NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom)
- DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE);
+ DrawTextureRec(target.texture, (Rectangle){ 0, 0, (float)target.texture.width, (float)-target.texture.height }, (Vector2){ 0, 0 }, WHITE);
EndShaderMode();
diff --git a/examples/shaders/shaders_rlgl_mesh_instanced.c b/examples/shaders/shaders_rlgl_mesh_instanced.c
index 7b72ba96..4ad647c0 100644
--- a/examples/shaders/shaders_rlgl_mesh_instanced.c
+++ b/examples/shaders/shaders_rlgl_mesh_instanced.c
@@ -56,14 +56,14 @@ int main(void)
// Scatter random cubes around
for (int i = 0; i < count; i++)
{
- float x = GetRandomValue(-50, 50);
- float y = GetRandomValue(-50, 50);
- float z = GetRandomValue(-50, 50);
+ float x = (float)GetRandomValue(-50, 50);
+ float y = (float)GetRandomValue(-50, 50);
+ float z = (float)GetRandomValue(-50, 50);
translations[i] = MatrixTranslate(x, y, z);
- x = GetRandomValue(0, 360);
- y = GetRandomValue(0, 360);
- z = GetRandomValue(0, 360);
+ x = (float)GetRandomValue(0, 360);
+ y = (float)GetRandomValue(0, 360);
+ z = (float)GetRandomValue(0, 360);
Vector3 axis = Vector3Normalize((Vector3){x, y, z});
float angle = (float)GetRandomValue(0, 10) * DEG2RAD;
diff --git a/examples/shaders/shaders_simple_mask.c b/examples/shaders/shaders_simple_mask.c
index 055afad7..b46b65c7 100644
--- a/examples/shaders/shaders_simple_mask.c
+++ b/examples/shaders/shaders_simple_mask.c
@@ -45,10 +45,10 @@ int main(void)
camera.projection = CAMERA_PERSPECTIVE;
// Define our three models to show the shader on
- Mesh torus = GenMeshTorus(.3, 1, 16, 32);
+ Mesh torus = GenMeshTorus(0.3f, 1, 16, 32);
Model model1 = LoadModelFromMesh(torus);
- Mesh cube = GenMeshCube(.8,.8,.8);
+ Mesh cube = GenMeshCube(0.8f,0.8f,0.8f);
Model model2 = LoadModelFromMesh(cube);
// Generate model to be shaded just to see the gaps in the other two
diff --git a/examples/shaders/shaders_texture_drawing.c b/examples/shaders/shaders_texture_drawing.c
index 9a88e41a..a8cd5abf 100644
--- a/examples/shaders/shaders_texture_drawing.c
+++ b/examples/shaders/shaders_texture_drawing.c
@@ -49,7 +49,7 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
- time = GetTime();
+ time = (float)GetTime();
SetShaderValue(shader, timeLoc, &time, SHADER_UNIFORM_FLOAT);
//----------------------------------------------------------------------------------