diff --git a/Sources/Audio/ALDevice.cpp b/Sources/Audio/ALDevice.cpp index 547870682..3535e747a 100644 --- a/Sources/Audio/ALDevice.cpp +++ b/Sources/Audio/ALDevice.cpp @@ -449,6 +449,15 @@ namespace spades { SPRaise("Failed to open OpenAL device."); } + + alContext = al::qalcCreateContext(alDevice, NULL); + if (!alContext) { + al::qalcCloseDevice(alDevice); + SPRaise("Failed to create OpenAL context."); + } + + al::qalcMakeContextCurrent(alContext); + SPLog("OpenAL Info:"); SPLog(" Vendor: %s", al::qalGetString(AL_VENDOR)); SPLog(" Version: %s", al::qalGetString(AL_VERSION)); @@ -462,14 +471,6 @@ namespace spades { } } - alContext = al::qalcCreateContext(alDevice, NULL); - if (UNLIKELY(!alContext)) { - al::qalcCloseDevice(alDevice); - SPRaise("Failed to create OpenAL context."); - } - - al::qalcMakeContextCurrent(alContext); - map = NULL; roomHistoryPos = 0;