mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-10 21:38:15 +00:00
Unload model shaders and textures
They are not automatically unloaded when unloading the model!
This commit is contained in:
@@ -98,6 +98,8 @@ int main(void)
|
|||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
UnloadTexture(texture); // Unload texture
|
||||||
|
|
||||||
// Unload model animations data
|
// Unload model animations data
|
||||||
for (int i = 0; i < animsCount; i++) UnloadModelAnimation(anims[i]);
|
for (int i = 0; i < animsCount; i++) UnloadModelAnimation(anims[i]);
|
||||||
RL_FREE(anims);
|
RL_FREE(anims);
|
||||||
|
@@ -100,7 +100,9 @@ int main(void)
|
|||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
UnloadModel(model); // Unload skybox model
|
// TODO: Unload materials and shaders
|
||||||
|
|
||||||
|
UnloadModel(model); // Unload model
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
@@ -115,11 +115,12 @@ int main(void)
|
|||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
UnloadTexture(texture); // Unload texture
|
||||||
|
|
||||||
// Unload models data (GPU VRAM)
|
// Unload models data (GPU VRAM)
|
||||||
for (int i = 0; i < NUM_MODELS; i++) UnloadModel(models[i]);
|
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;
|
return 0;
|
||||||
|
@@ -116,6 +116,7 @@ int main(void)
|
|||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
UnloadTexture(texture); // Unload texture
|
||||||
UnloadModel(model); // Unload model
|
UnloadModel(model); // Unload model
|
||||||
|
|
||||||
ClearDroppedFiles(); // Clear internal buffers
|
ClearDroppedFiles(); // Clear internal buffers
|
||||||
|
@@ -89,7 +89,10 @@ int main(void)
|
|||||||
|
|
||||||
// De-Initialization
|
// 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
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
@@ -169,6 +169,7 @@ int main(void)
|
|||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Unload all loaded data
|
// Unload all loaded data
|
||||||
|
UnloadTexture(model.materials[0].maps[MAP_DIFFUSE].texture);
|
||||||
UnloadModel(model);
|
UnloadModel(model);
|
||||||
|
|
||||||
UnloadRenderTexture(framebuffer);
|
UnloadRenderTexture(framebuffer);
|
||||||
|
Reference in New Issue
Block a user