Skip to content

Commit

Permalink
BLUGA-GRAPHICS: Add unload music sound
Browse files Browse the repository at this point in the history
  • Loading branch information
Saverio976 committed Nov 5, 2023
1 parent f80e7f4 commit 96d0f65
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libs/B-luga-graphics/src/RaylibImpl/Audio/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,18 @@ namespace Raylib {
{
return _path;
}

~SoundImpl::SoundImpl()
{
if (isReady()) {
unload();
}
}

~MusicImpl::MusicImpl()
{
if (isReady()) {
unload();
}
}
} // namespace Raylib
4 changes: 4 additions & 0 deletions libs/B-luga-graphics/src/RaylibImpl/Audio/Audio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace Raylib {
public:
SoundImpl(const std::string& fileName, float volume);

~SoundImpl();

bool isReady() const override;

void unload() override;
Expand Down Expand Up @@ -56,6 +58,8 @@ namespace Raylib {
public:
MusicImpl(const std::string& fileName, float volume);

~MusicImpl();

void unload() override;

bool isReady() const override;
Expand Down

0 comments on commit 96d0f65

Please sign in to comment.