aboutsummaryrefslogtreecommitdiff
path: root/raylib/examples/models
diff options
context:
space:
mode:
Diffstat (limited to 'raylib/examples/models')
-rw-r--r--raylib/examples/models/models_animation.c2
-rw-r--r--raylib/examples/models/models_loading_gltf.c2
-rw-r--r--raylib/examples/models/models_loading_m3d.c4
-rw-r--r--raylib/examples/models/models_mesh_generation.c2
-rw-r--r--raylib/examples/models/models_skybox.c13
5 files changed, 12 insertions, 11 deletions
diff --git a/raylib/examples/models/models_animation.c b/raylib/examples/models/models_animation.c
index ffe2d01..8e6f7f8 100644
--- a/raylib/examples/models/models_animation.c
+++ b/raylib/examples/models/models_animation.c
@@ -48,7 +48,7 @@ int main(void)
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
// Load animation data
- unsigned int animsCount = 0;
+ int animsCount = 0;
ModelAnimation *anims = LoadModelAnimations("resources/models/iqm/guyanim.iqm", &animsCount);
int animFrameCounter = 0;
diff --git a/raylib/examples/models/models_loading_gltf.c b/raylib/examples/models/models_loading_gltf.c
index 2884731..1d5d516 100644
--- a/raylib/examples/models/models_loading_gltf.c
+++ b/raylib/examples/models/models_loading_gltf.c
@@ -44,7 +44,7 @@ int main(void)
Model model = LoadModel("resources/models/gltf/robot.glb");
// Load gltf model animations
- unsigned int animsCount = 0;
+ int animsCount = 0;
unsigned int animIndex = 0;
unsigned int animCurrentFrame = 0;
ModelAnimation *modelAnimations = LoadModelAnimations("resources/models/gltf/robot.glb", &animsCount);
diff --git a/raylib/examples/models/models_loading_m3d.c b/raylib/examples/models/models_loading_m3d.c
index 1e56d51..71dbc8d 100644
--- a/raylib/examples/models/models_loading_m3d.c
+++ b/raylib/examples/models/models_loading_m3d.c
@@ -50,7 +50,7 @@ int main(void)
Model model = LoadModel(modelFileName); // Load the bind-pose model mesh and basic data
// Load animations
- unsigned int animsCount = 0;
+ int animsCount = 0;
int animFrameCounter = 0, animId = 0;
ModelAnimation *anims = LoadModelAnimations(modelFileName, &animsCount); // Load skeletal animation data
@@ -85,7 +85,7 @@ int main(void)
animFrameCounter = 0;
animId++;
- if (animId >= animsCount) animId = 0;
+ if (animId >= (int)animsCount) animId = 0;
UpdateModelAnimation(model, anims[animId], 0);
animPlaying = true;
}
diff --git a/raylib/examples/models/models_mesh_generation.c b/raylib/examples/models/models_mesh_generation.c
index d17a20a..94e0a4c 100644
--- a/raylib/examples/models/models_mesh_generation.c
+++ b/raylib/examples/models/models_mesh_generation.c
@@ -36,7 +36,7 @@ int main(void)
Model models[NUM_MODELS] = { 0 };
- models[0] = LoadModelFromMesh(GenMeshPlane(2, 2, 5, 5));
+ models[0] = LoadModelFromMesh(GenMeshPlane(2, 2, 4, 3));
models[1] = LoadModelFromMesh(GenMeshCube(2.0f, 1.0f, 2.0f));
models[2] = LoadModelFromMesh(GenMeshSphere(2, 32, 32));
models[3] = LoadModelFromMesh(GenMeshHemiSphere(2, 16, 16));
diff --git a/raylib/examples/models/models_skybox.c b/raylib/examples/models/models_skybox.c
index 7a500e0..c583128 100644
--- a/raylib/examples/models/models_skybox.c
+++ b/raylib/examples/models/models_skybox.c
@@ -68,14 +68,12 @@ int main(void)
char skyboxFileName[256] = { 0 };
- Texture2D panorama;
-
if (useHDR)
{
TextCopy(skyboxFileName, "resources/dresden_square_2k.hdr");
// Load HDR panorama (sphere) texture
- panorama = LoadTexture(skyboxFileName);
+ Texture2D panorama = LoadTexture(skyboxFileName);
// Generate cubemap (texture with 6 quads-cube-mapping) from panorama HDR texture
// NOTE 1: New texture is generated rendering to texture, shader calculates the sphere->cube coordinates mapping
@@ -83,7 +81,7 @@ int main(void)
// 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);
- //UnloadTexture(panorama); // Texture not required anymore, cubemap already generated
+ UnloadTexture(panorama); // Texture not required anymore, cubemap already generated
}
else
{
@@ -113,15 +111,18 @@ int main(void)
{
if (IsFileExtension(droppedFiles.paths[0], ".png;.jpg;.hdr;.bmp;.tga"))
{
- // Unload current cubemap texture and load new one
+ // Unload current cubemap texture to load new one
UnloadTexture(skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture);
+
if (useHDR)
{
+ // Load HDR panorama (sphere) texture
Texture2D panorama = LoadTexture(droppedFiles.paths[0]);
// Generate cubemap from panorama texture
skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8);
- UnloadTexture(panorama);
+
+ UnloadTexture(panorama); // Texture not required anymore, cubemap already generated
}
else
{