aboutsummaryrefslogtreecommitdiff
path: root/src/example
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-19 10:29:26 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-19 10:29:26 +0100
commitc3c3476f1d82aa83d8f8dc706488475dc2cf1e55 (patch)
tree3ee5011a9b758c3b544e297977ad4ac79d830df0 /src/example
parent73598a9e7f49047d74ca439cb0f300099d8c03bf (diff)
parent5f39dc386cce357a7c71a81c523a90496f7b1e67 (diff)
merge `loek/util`
Diffstat (limited to 'src/example')
-rw-r--r--src/example/audio_internal.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/example/audio_internal.cpp b/src/example/audio_internal.cpp
index e23d485..f3bf349 100644
--- a/src/example/audio_internal.cpp
+++ b/src/example/audio_internal.cpp
@@ -29,15 +29,11 @@ int main() {
SoundContext ctx{};
Sound sound{ctx};
// Load a background track (Ogg Vorbis)
- auto _bgm = sound.clone(Asset{"mwe/audio/bgm.ogg"});
- Sound & bgm = *dynamic_cast<Sound *>(_bgm.get());
+ auto bgm = Sound("mwe/audio/bgm.ogg");
// Load three short samples (WAV)
- auto _sfx1 = sound.clone(Asset{"mwe/audio/sfx1.wav"});
- Sound & sfx1 = *dynamic_cast<Sound *>(_sfx1.get());
- auto _sfx2 = sound.clone(Asset{"mwe/audio/sfx2.wav"});
- Sound & sfx2 = *dynamic_cast<Sound *>(_sfx2.get());
- auto _sfx3 = sound.clone(Asset{"mwe/audio/sfx3.wav"});
- Sound & sfx3 = *dynamic_cast<Sound *>(_sfx3.get());
+ auto sfx1 = Sound("mwe/audio/sfx1.wav");
+ auto sfx2 = Sound("mwe/audio/sfx2.wav");
+ auto sfx3 = Sound("mwe/audio/sfx3.wav");
// Start the background track
bgm.play();