diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-22 11:29:32 -0400 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-22 11:29:32 -0400 |
commit | 5d07a3c1016a625dc1f44b54eac6dd4af7e60ea6 (patch) | |
tree | 68f52d325896052d041a93e1278b1f3bf3d53c67 /engine/xe_sound_device.cpp | |
parent | start implementing openal soft (diff) | |
download | minecraftvulkan-5d07a3c1016a625dc1f44b54eac6dd4af7e60ea6.tar.gz minecraftvulkan-5d07a3c1016a625dc1f44b54eac6dd4af7e60ea6.tar.bz2 minecraftvulkan-5d07a3c1016a625dc1f44b54eac6dd4af7e60ea6.zip |
add alut
Diffstat (limited to '')
-rw-r--r-- | engine/xe_sound_device.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/engine/xe_sound_device.cpp b/engine/xe_sound_device.cpp index 0b85b6a..3bc931d 100644 --- a/engine/xe_sound_device.cpp +++ b/engine/xe_sound_device.cpp @@ -8,57 +8,57 @@ namespace xe { XeSoundDevice::XeSoundDevice() { - ALboolean enumeration; - enumeration = alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT"); - if (enumeration == AL_FALSE) { - fprintf(stderr, "enumeration extension not available\n"); - listAudioDevices(alcGetString(NULL, ALC_DEVICE_SPECIFIER)); - } +// ALboolean enumeration; +// enumeration = alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT"); +// if (enumeration == AL_FALSE) { +// fprintf(stderr, "enumeration extension not available\n"); +// listAudioDevices(alcGetString(NULL, ALC_DEVICE_SPECIFIER)); +// } - listAudioDevices(alcGetString(NULL, ALC_DEVICE_SPECIFIER)); +// listAudioDevices(alcGetString(NULL, ALC_DEVICE_SPECIFIER)); - const ALCchar* name = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); +// const ALCchar* name = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); - device = alcOpenDevice(name); - if (!device) { - std::runtime_error("failed to get sound device"); - } +// device = alcOpenDevice(name); +// if (!device) { +// std::runtime_error("failed to get sound device"); +// } - std::cout << "Audio Device: " << alcGetString(device, ALC_DEVICE_SPECIFIER) << "\n"; +// std::cout << "Audio Device: " << alcGetString(device, ALC_DEVICE_SPECIFIER) << "\n"; - context = alcCreateContext(device, NULL); - if(!alcMakeContextCurrent(context)) { - std::runtime_error("failed to make sound context current"); - } +// context = alcCreateContext(device, NULL); +// if(!alcMakeContextCurrent(context)) { +// std::runtime_error("failed to make sound context current"); +// } - alListener3f(AL_POSITION, 0.f, 0.f, 0.f); - alListener3f(AL_VELOCITY, 0.f, 0.f, 0.f); - ALfloat frontAndUpVectors[] = { - /* front*/1.f, 0.f, 0.f, - /* up */ 0.f, 1.f, 0.f - }; - alListenerfv(AL_ORIENTATION, frontAndUpVectors); +// alListener3f(AL_POSITION, 0.f, 0.f, 0.f); +// alListener3f(AL_VELOCITY, 0.f, 0.f, 0.f); +// ALfloat frontAndUpVectors[] = { +// /* front*/1.f, 0.f, 0.f, +// /* up */ 0.f, 1.f, 0.f +// }; +// alListenerfv(AL_ORIENTATION, frontAndUpVectors); -} +// } -void XeSoundDevice::listAudioDevices(const ALCchar* devices) { - const ALCchar *device = devices, *next = devices + 1; - size_t len = 0; +// void XeSoundDevice::listAudioDevices(const ALCchar* devices) { +// const ALCchar *device = devices, *next = devices + 1; +// size_t len = 0; - fprintf(stdout, "Devices list: "); - while (device && *device != '\0' && next && *next != '\0') { - fprintf(stdout, "%s, ", device); - len = strlen(device); - device += (len + 1); - next += (len + 2); - } - std::cout << "\n"; +// fprintf(stdout, "Devices list: "); +// while (device && *device != '\0' && next && *next != '\0') { +// fprintf(stdout, "%s, ", device); +// len = strlen(device); +// device += (len + 1); +// next += (len + 2); +// } +// std::cout << "\n"; } XeSoundDevice::~XeSoundDevice() { - alcMakeContextCurrent(nullptr); - alcDestroyContext(context); - alcCloseDevice(device); + // alcMakeContextCurrent(nullptr); + // alcDestroyContext(context); + // alcCloseDevice(device); } }
\ No newline at end of file |