diff options
| author | Jeffery Myers <[email protected]> | 2021-03-22 23:51:52 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-23 07:51:52 +0100 |
| commit | e48b9a6da1d3dd6163b1596e47c58e7026530dc1 (patch) | |
| tree | 9d1bca87d19ae07f7605c112c53971531b109dc2 /examples/models | |
| parent | c6dd41495b2c0d96cf4d1ca108729ec87c9a0b53 (diff) | |
| download | raylib-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/models')
| -rw-r--r-- | examples/models/models_cubicmap.c | 2 | ||||
| -rw-r--r-- | examples/models/models_first_person_maze.c | 2 | ||||
| -rw-r--r-- | examples/models/models_material_pbr.c | 9 | ||||
| -rw-r--r-- | examples/models/models_mesh_picking.c | 4 | ||||
| -rw-r--r-- | examples/models/models_skybox.c | 4 |
5 files changed, 11 insertions, 10 deletions
diff --git a/examples/models/models_cubicmap.c b/examples/models/models_cubicmap.c index 08060787..0a566581 100644 --- a/examples/models/models_cubicmap.c +++ b/examples/models/models_cubicmap.c @@ -62,7 +62,7 @@ int main(void) EndMode3D(); - DrawTextureEx(cubicmap, (Vector2){ screenWidth - cubicmap.width*4 - 20, 20 }, 0.0f, 4.0f, WHITE); + DrawTextureEx(cubicmap, (Vector2){ screenWidth - cubicmap.width*4.0f - 20, 20.0f }, 0.0f, 4.0f, WHITE); DrawRectangleLines(screenWidth - cubicmap.width*4 - 20, 20, cubicmap.width*4, cubicmap.height*4, GREEN); DrawText("cubicmap image used to", 658, 90, 10, GRAY); diff --git a/examples/models/models_first_person_maze.c b/examples/models/models_first_person_maze.c index 94ebf943..08a9b5cf 100644 --- a/examples/models/models_first_person_maze.c +++ b/examples/models/models_first_person_maze.c @@ -95,7 +95,7 @@ int main(void) DrawModel(model, mapPosition, 1.0f, WHITE); // Draw maze map EndMode3D(); - DrawTextureEx(cubicmap, (Vector2){ GetScreenWidth() - cubicmap.width*4 - 20, 20 }, 0.0f, 4.0f, WHITE); + DrawTextureEx(cubicmap, (Vector2){ GetScreenWidth() - cubicmap.width*4.0f - 20, 20.0f }, 0.0f, 4.0f, WHITE); DrawRectangleLines(GetScreenWidth() - cubicmap.width*4 - 20, 20, cubicmap.width*4, cubicmap.height*4, GREEN); // Draw player position radar diff --git a/examples/models/models_material_pbr.c b/examples/models/models_material_pbr.c index fb3f9569..36f03636 100644 --- a/examples/models/models_material_pbr.c +++ b/examples/models/models_material_pbr.c @@ -14,6 +14,7 @@ #include "raylib.h" #include "raymath.h" +#include "rlgl.h" #include <stdio.h> @@ -187,7 +188,7 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness) Shader shdrCubemap = LoadShader("resources/shaders/glsl100/cubemap.vs", "resources/shaders/glsl100/cubemap.fs"); #endif SetShaderValue(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, SHADER_UNIFORM_INT); - TextureCubemap cubemap = GenTextureCubemap(shdrCubemap, panorama, CUBEMAP_SIZE, PIXELFORMAT_UNCOMPRESSED_R32G32B32); + TextureCubemap cubemap = rlGenTextureCubemap(shdrCubemap, panorama, CUBEMAP_SIZE, PIXELFORMAT_UNCOMPRESSED_R32G32B32); UnloadTexture(panorama); UnloadShader(shdrCubemap); //-------------------------------------------------------------------------------------------------------- @@ -201,7 +202,7 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness) Shader shdrIrradiance = LoadShader("resources/shaders/glsl100/skybox.vs", "resources/shaders/glsl100/irradiance.fs"); #endif SetShaderValue(shdrIrradiance, GetShaderLocation(shdrIrradiance, "environmentMap"), (int[1]){ 0 }, SHADER_UNIFORM_INT); - mat.maps[MATERIAL_MAP_IRRADIANCE].texture = GenTextureIrradiance(shdrIrradiance, cubemap, IRRADIANCE_SIZE); + mat.maps[MATERIAL_MAP_IRRADIANCE].texture = rlGenTextureIrradiance(shdrIrradiance, cubemap, IRRADIANCE_SIZE); UnloadShader(shdrIrradiance); //-------------------------------------------------------------------------------------------------------- @@ -214,7 +215,7 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness) Shader shdrPrefilter = LoadShader("resources/shaders/glsl100/skybox.vs", "resources/shaders/glsl100/prefilter.fs"); #endif SetShaderValue(shdrPrefilter, GetShaderLocation(shdrPrefilter, "environmentMap"), (int[1]){ 0 }, SHADER_UNIFORM_INT); - mat.maps[MATERIAL_MAP_PREFILTER].texture = GenTexturePrefilter(shdrPrefilter, cubemap, PREFILTERED_SIZE); + mat.maps[MATERIAL_MAP_PREFILTER].texture = rlGenTexturePrefilter(shdrPrefilter, cubemap, PREFILTERED_SIZE); UnloadTexture(cubemap); UnloadShader(shdrPrefilter); //-------------------------------------------------------------------------------------------------------- @@ -226,7 +227,7 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness) #else Shader shdrBRDF = LoadShader("resources/shaders/glsl100/brdf.vs", "resources/shaders/glsl100/brdf.fs"); #endif - mat.maps[MATERIAL_MAP_BRDG].texture = GenTextureBRDF(shdrBRDF, BRDF_SIZE); + mat.maps[MATERIAL_MAP_BRDG].texture = rlGenTextureBRDF(shdrBRDF, BRDF_SIZE); UnloadShader(shdrBRDF); //-------------------------------------------------------------------------------------------------------- diff --git a/examples/models/models_mesh_picking.c b/examples/models/models_mesh_picking.c index 8ade0b06..78c7c45c 100644 --- a/examples/models/models_mesh_picking.c +++ b/examples/models/models_mesh_picking.c @@ -142,8 +142,8 @@ int main(void) // If we hit something, draw the cursor at the hit point if (nearestHit.hit) { - DrawCube(nearestHit.position, 0.3, 0.3, 0.3, cursorColor); - DrawCubeWires(nearestHit.position, 0.3, 0.3, 0.3, RED); + DrawCube(nearestHit.position, 0.3f, 0.3f, 0.3f, cursorColor); + DrawCubeWires(nearestHit.position, 0.3f, 0.3f, 0.3f, RED); Vector3 normalEnd; normalEnd.x = nearestHit.position.x + nearestHit.normal.x; diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index d44b11b6..e03aaab0 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -62,7 +62,7 @@ int main(void) // NOTE 1: New texture is generated rendering to texture, shader calculates the sphere->cube coordinates mapping // NOTE 2: It seems on some Android devices WebGL, fbo does not properly support a FLOAT-based attachment, // despite texture can be successfully created.. so using PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 instead of PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 - skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); + skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = rlGenTextureCubemap(shdrCubemap, panorama, 1024, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); UnloadTexture(panorama); // Texture not required anymore, cubemap already generated } @@ -102,7 +102,7 @@ int main(void) Texture2D panorama = LoadTexture(droppedFiles[0]); // Generate cubemap from panorama texture - skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); + skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = rlGenTextureCubemap(shdrCubemap, panorama, 1024, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); UnloadTexture(panorama); } else |
