16
0
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:
milek7
2017-08-25 22:02:31 +02:00
parent 9d91b19841
commit 83c0f4b8e2
4 changed files with 76 additions and 35 deletions

View File

@@ -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;