diff options
| author | Jeffery Myers <[email protected]> | 2023-11-06 11:31:07 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-06 20:31:07 +0100 |
| commit | 6cd37e57a6b38bb06cc54ecf6aa7659d4895723b (patch) | |
| tree | d3dee9e7f62fc74ee06caa51b99b684292bb3f24 /examples/shaders | |
| parent | fc21a8e552c452804838bfbbbaadaf044a74b81e (diff) | |
| download | raylib-6cd37e57a6b38bb06cc54ecf6aa7659d4895723b.tar.gz raylib-6cd37e57a6b38bb06cc54ecf6aa7659d4895723b.zip | |
Fix warnings in visual studio (#3512)
Diffstat (limited to 'examples/shaders')
| -rw-r--r-- | examples/shaders/shaders_hybrid_render.c | 8 | ||||
| -rw-r--r-- | examples/shaders/shaders_write_depth.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/shaders/shaders_hybrid_render.c b/examples/shaders/shaders_hybrid_render.c index 53e14b88..00121fb7 100644 --- a/examples/shaders/shaders_hybrid_render.c +++ b/examples/shaders/shaders_hybrid_render.c @@ -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(); //---------------------------------------------------------------------------------- diff --git a/examples/shaders/shaders_write_depth.c b/examples/shaders/shaders_write_depth.c index d9e40d0d..ef011693 100644 --- a/examples/shaders/shaders_write_depth.c +++ b/examples/shaders/shaders_write_depth.c @@ -92,7 +92,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(); //---------------------------------------------------------------------------------- |
