Browse Source

Audio: Clear error for alcCreateContext failure on emscripten

Emscripten AL does not support specifying attributes and does not set a
ALC error when alcCreateContext fails.

Signed-off-by: Squareys <squareys@googlemail.com>
pull/217/head
Squareys 9 years ago committed by Vladimír Vondruš
parent
commit
20110358b0
  1. 6
      src/Magnum/Audio/Context.cpp

6
src/Magnum/Audio/Context.cpp

@ -215,7 +215,13 @@ bool Context::tryCreateContext(const Configuration& config) {
attributes[last++] = config.refreshRate(); attributes[last++] = config.refreshRate();
} }
#ifndef CORRADE_TARGET_EMSCRIPTEN
_context = alcCreateContext(_device, attributes); _context = alcCreateContext(_device, attributes);
#else
if(last != 0)
Warning() << "Audio::Context::tryCreateContext(): specifying attributes is not supported with Emscripten, ignoring";
_context = alcCreateContext(_device, nullptr);
#endif
return !!_context; return !!_context;
} }

Loading…
Cancel
Save