mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
memory-related refactor
This commit is contained in:
parent
f47c7d00a2
commit
c5f663b7cb
16 changed files with 205 additions and 209 deletions
|
|
@ -389,7 +389,7 @@ std::unique_ptr<Stream> ALAudio::openStream(std::shared_ptr<PCMStream> stream, b
|
|||
return std::make_unique<ALStream>(this, stream, keepSource);
|
||||
}
|
||||
|
||||
ALAudio* ALAudio::create() {
|
||||
std::unique_ptr<ALAudio> ALAudio::create() {
|
||||
ALCdevice* device = alcOpenDevice(nullptr);
|
||||
if (device == nullptr)
|
||||
return nullptr;
|
||||
|
|
@ -400,7 +400,7 @@ ALAudio* ALAudio::create() {
|
|||
}
|
||||
AL_CHECK();
|
||||
logger.info() << "initialized";
|
||||
return new ALAudio(device, context);
|
||||
return std::make_unique<ALAudio>(device, context);
|
||||
}
|
||||
|
||||
uint ALAudio::getFreeSource(){
|
||||
|
|
|
|||
|
|
@ -136,9 +136,8 @@ namespace audio {
|
|||
std::vector<uint> freebuffers;
|
||||
|
||||
uint maxSources = 256;
|
||||
|
||||
ALAudio(ALCdevice* device, ALCcontext* context);
|
||||
public:
|
||||
ALAudio(ALCdevice* device, ALCcontext* context);
|
||||
~ALAudio();
|
||||
|
||||
uint getFreeSource();
|
||||
|
|
@ -164,7 +163,7 @@ namespace audio {
|
|||
return false;
|
||||
}
|
||||
|
||||
static ALAudio* create();
|
||||
static std::unique_ptr<ALAudio> create();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue