aboutsummaryrefslogtreecommitdiff
path: root/raylib/examples/shaders/shaders_hybrid_render.c
diff options
context:
space:
mode:
authorUneven Prankster <unevenprankster@protonmail.com>2023-11-16 21:12:27 -0300
committerUneven Prankster <unevenprankster@protonmail.com>2023-11-16 21:12:27 -0300
commit2bbf92ad5ae7708bf18ac7ef333e9a979d8d1bde (patch)
treec9d22bb0d73d9cc0c8586e4d31c93a561ea8e910 /raylib/examples/shaders/shaders_hybrid_render.c
parent1c0cc775732201f4c4d3ee0d6772be786b3b4aa1 (diff)
Working so hard like a soldiermain
Can't afford a thing on TV
Diffstat (limited to 'raylib/examples/shaders/shaders_hybrid_render.c')
-rw-r--r--raylib/examples/shaders/shaders_hybrid_render.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/raylib/examples/shaders/shaders_hybrid_render.c b/raylib/examples/shaders/shaders_hybrid_render.c
index 53e14b8..6242b30 100644
--- a/raylib/examples/shaders/shaders_hybrid_render.c
+++ b/raylib/examples/shaders/shaders_hybrid_render.c
@@ -1,4 +1,4 @@
-/*******************************************************************************************
+/*******************************************************************************************
*
* raylib [shaders] example - Hybrid Rendering
*
@@ -68,7 +68,7 @@ int main(void)
marchLocs.screenCenter = GetShaderLocation(shdrRaymarch, "screenCenter");
// Transfer screenCenter position to shader. Which is used to calculate ray direction.
- Vector2 screenCenter = {.x = screenWidth/2.0, .y = screenHeight/2.0};
+ Vector2 screenCenter = {.x = screenWidth/2.0f, .y = screenHeight/2.0f};
SetShaderValue(shdrRaymarch, marchLocs.screenCenter , &screenCenter , SHADER_UNIFORM_VEC2);
// Use Customized function to create writable depth texture buffer
@@ -84,7 +84,7 @@ int main(void)
};
// Camera FOV is pre-calculated in the camera Distance.
- double camDist = 1.0/(tan(camera.fovy*0.5*DEG2RAD));
+ float camDist = 1.0f/(tanf(camera.fovy*0.5f*DEG2RAD));
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -113,7 +113,7 @@ int main(void)
// Raymarch Scene
rlEnableDepthTest(); //Manually enable Depth Test to handle multiple rendering methods.
BeginShaderMode(shdrRaymarch);
- DrawRectangleRec((Rectangle){0,0,screenWidth,screenHeight},WHITE);
+ DrawRectangleRec((Rectangle){0,0, (float)screenWidth, (float)screenHeight},WHITE);
EndShaderMode();
// Raserize Scene
@@ -132,7 +132,7 @@ int main(void)
BeginDrawing();
ClearBackground(RAYWHITE);
- DrawTextureRec(target.texture, (Rectangle) { 0, 0, screenWidth, -screenHeight }, (Vector2) { 0, 0 }, WHITE);
+ DrawTextureRec(target.texture, (Rectangle) { 0, 0, (float)screenWidth, (float)-screenHeight }, (Vector2) { 0, 0 }, WHITE);
DrawFPS(10, 10);
EndDrawing();
//----------------------------------------------------------------------------------