diff --git a/lib/Ray/sources/Model/Model.cpp b/lib/Ray/sources/Model/Model.cpp index 6be81120..791d95b3 100644 --- a/lib/Ray/sources/Model/Model.cpp +++ b/lib/Ray/sources/Model/Model.cpp @@ -19,7 +19,7 @@ RAY::Model::Model(const Mesh &mesh): RAY::Model::~Model() { - UnloadModel(this->_model); + this->unload(); } bool RAY::Model::load(const std::string &filename) @@ -34,6 +34,12 @@ bool RAY::Model::load(const Mesh &mesh) return true; } +bool RAY::Model::unload() +{ + UnloadModel(this->_model); + return true; +} + bool RAY::Model::unloadKeepMeshes() { UnloadModelKeepMeshes(_model); diff --git a/lib/Ray/sources/Model/Model.hpp b/lib/Ray/sources/Model/Model.hpp index 67a846c1..c131d63c 100644 --- a/lib/Ray/sources/Model/Model.hpp +++ b/lib/Ray/sources/Model/Model.hpp @@ -45,6 +45,9 @@ namespace RAY { //! @brief Load model from mesh (default materials) bool load(const Mesh &mesh); + //! @brief Unload model (including meshes) from memory (RAM and/or VRAM) + bool unload() override; + //! @brief Unload model (excluding meshes) from memory (RAM and/or VRAM) bool unloadKeepMeshes();