mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 20:59:19 +02:00
use openal-soft extensions to pause sounds and defer updates
This commit is contained in:
9
sound.h
9
sound.h
@@ -134,9 +134,16 @@ public:
|
||||
|
||||
class sound_manager
|
||||
{
|
||||
static bool created;
|
||||
|
||||
ALCdevice *dev;
|
||||
ALCcontext *ctx;
|
||||
|
||||
void (*alDeferUpdatesSOFT)() = nullptr;
|
||||
void (*alProcessUpdatesSOFT)() = nullptr;
|
||||
void (*alcDevicePauseSOFT)(ALCdevice*) = nullptr;
|
||||
void (*alcDeviceResumeSOFT)(ALCdevice*) = nullptr;
|
||||
|
||||
const std::chrono::duration<float> gc_time = std::chrono::duration<float>(60.0f);
|
||||
std::unordered_map<std::string, sound_buffer*> buffers;
|
||||
std::unordered_set<sound*> sounds;
|
||||
@@ -163,4 +170,4 @@ public:
|
||||
void set_listener(Math3D::vector3 const &pos, Math3D::vector3 const &at, Math3D::vector3 const &up);
|
||||
};
|
||||
|
||||
extern sound_manager* sound_man;
|
||||
extern std::unique_ptr<sound_manager> sound_man;
|
||||
|
||||
Reference in New Issue
Block a user