aboutsummaryrefslogtreecommitdiff
path: root/examples/models
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2019-08-26 21:19:04 +0200
committerraysan5 <raysan5@gmail.com>2019-08-26 21:19:04 +0200
commit37a6f120377e28d5499f130ff346848a3983bee8 (patch)
treee2b01adb9de0326c34c7776a5c742d1c3725c8dd /examples/models
parentaddbd88833ffc9a2bd1fe33a83e683245324abd0 (diff)
downloadraylib-37a6f120377e28d5499f130ff346848a3983bee8.tar.gz
raylib-37a6f120377e28d5499f130ff346848a3983bee8.zip
Unload model shaders and textures
They are not automatically unloaded when unloading the model!
Diffstat (limited to 'examples/models')
-rw-r--r--examples/models/models_animation.c2
-rw-r--r--examples/models/models_material_pbr.c4
-rw-r--r--examples/models/models_mesh_generation.c3
-rw-r--r--examples/models/models_obj_viewer.c1
-rw-r--r--examples/models/models_skybox.c5
-rw-r--r--examples/models/models_yaw_pitch_roll.c1
6 files changed, 13 insertions, 3 deletions
diff --git a/examples/models/models_animation.c b/examples/models/models_animation.c
index 5e7c8cf5..2aa321cf 100644
--- a/examples/models/models_animation.c
+++ b/examples/models/models_animation.c
@@ -98,6 +98,8 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
+ UnloadTexture(texture); // Unload texture
+
// Unload model animations data
for (int i = 0; i < animsCount; i++) UnloadModelAnimation(anims[i]);
RL_FREE(anims);
diff --git a/examples/models/models_material_pbr.c b/examples/models/models_material_pbr.c
index 8d51eefd..fea30cf4 100644
--- a/examples/models/models_material_pbr.c
+++ b/examples/models/models_material_pbr.c
@@ -100,7 +100,9 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
- UnloadModel(model); // Unload skybox model
+ // TODO: Unload materials and shaders
+
+ UnloadModel(model); // Unload model
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
diff --git a/examples/models/models_mesh_generation.c b/examples/models/models_mesh_generation.c
index 6c0ae653..eaecb271 100644
--- a/examples/models/models_mesh_generation.c
+++ b/examples/models/models_mesh_generation.c
@@ -115,11 +115,12 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
+ UnloadTexture(texture); // Unload texture
// Unload models data (GPU VRAM)
for (int i = 0; i < NUM_MODELS; i++) UnloadModel(models[i]);
- CloseWindow(); // Close window and OpenGL context
+ CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
diff --git a/examples/models/models_obj_viewer.c b/examples/models/models_obj_viewer.c
index 3f43e1c8..1d15fdd9 100644
--- a/examples/models/models_obj_viewer.c
+++ b/examples/models/models_obj_viewer.c
@@ -116,6 +116,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
+ UnloadTexture(texture); // Unload texture
UnloadModel(model); // Unload model
ClearDroppedFiles(); // Clear internal buffers
diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c
index bad29b96..c2849032 100644
--- a/examples/models/models_skybox.c
+++ b/examples/models/models_skybox.c
@@ -89,7 +89,10 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
- UnloadModel(skybox); // Unload skybox model (and textures)
+ UnloadShader(skybox.materials[0].shader);
+ UnloadTexture(skybox.materials[0].maps[MAP_CUBEMAP].texture);
+
+ UnloadModel(skybox); // Unload skybox model
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
diff --git a/examples/models/models_yaw_pitch_roll.c b/examples/models/models_yaw_pitch_roll.c
index 72529d89..65273811 100644
--- a/examples/models/models_yaw_pitch_roll.c
+++ b/examples/models/models_yaw_pitch_roll.c
@@ -169,6 +169,7 @@ int main(void)
//--------------------------------------------------------------------------------------
// Unload all loaded data
+ UnloadTexture(model.materials[0].maps[MAP_DIFFUSE].texture);
UnloadModel(model);
UnloadRenderTexture(framebuffer);