Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
sdl_sound_instance.h
Go to the documentation of this file.
1#pragma once
2
3#include <SDL3/SDL.h>
4#include <SDL3/SDL_audio.h>
7
13 public:
14 SDLSoundInstance(std::shared_ptr<SoundResource> resource,
15 float volume = 1.0f);
17
18 void play() override;
19 void pause() override;
20 void resume() override;
21 void stop() override;
22
23 [[nodiscard]] bool is_playing() const noexcept override;
24 [[nodiscard]] bool is_paused() const noexcept override;
25 [[nodiscard]] bool is_finished() override;
26
27 private:
28 std::unique_ptr<SDL_AudioStream, decltype(&SDL_DestroyAudioStream)> stream_{
29 nullptr, &SDL_DestroyAudioStream};
30};
Represents a SDL-specific implementation of a sound instance. Inherits from the generic SoundInstance...
Definition sdl_sound_instance.h:12
void pause() override
bool is_finished() override
bool is_playing() const noexcept override
bool is_paused() const noexcept override
~SDLSoundInstance() override
void resume() override
void play() override
void stop() override
SDLSoundInstance(std::shared_ptr< SoundResource > resource, float volume=1.0f)
Represents an instance of a generic sound within the audio system. The reason for separating SoundIns...
Definition sound_instance.h:14
const std::shared_ptr< SoundResource > & resource() const noexcept
float volume() const noexcept