mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-08 14:58:11 -04:00
Add AudioSpec empty constructor
This commit is contained in:
parent
724e3f37a8
commit
e034f6cd67
@ -42,6 +42,7 @@ private:
|
||||
static void SDLCallback(void *userdata, Uint8* stream, int len);
|
||||
|
||||
public:
|
||||
AudioSpec();
|
||||
AudioSpec(int freq, SDL_AudioFormat format, Uint8 channels, Uint16 samples, AudioCallback&& callback = AudioCallback());
|
||||
~AudioSpec();
|
||||
|
||||
|
@ -30,6 +30,10 @@ void AudioSpec::SDLCallback(void *userdata, Uint8* stream, int len) {
|
||||
audiospec->callback_(stream, len);
|
||||
}
|
||||
|
||||
AudioSpec::AudioSpec() {
|
||||
std::fill((char*)this, (char*)this + sizeof(SDL_AudioSpec), 0);
|
||||
}
|
||||
|
||||
AudioSpec::AudioSpec(int freq, SDL_AudioFormat format, Uint8 channels, Uint16 samples, AudioSpec::AudioCallback&& callback)
|
||||
: callback_(std::move(callback)) {
|
||||
std::fill((char*)this, (char*)this + sizeof(SDL_AudioSpec), 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user