X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdevice.cpp;h=c866b32f704e620c5c331dc6b34182e84e6b8f48;hb=HEAD;hp=422b7ea2f8e055970c6ba9d6d9297c60a0f95e58;hpb=35ea5cc8d1eb8c806885d27441548f630e7b1266;p=libs%2Fal.git diff --git a/source/device.cpp b/source/device.cpp index 422b7ea..c866b32 100644 --- a/source/device.cpp +++ b/source/device.cpp @@ -1,11 +1,4 @@ -/* $Id$ - -This file is part of libmspal -Copyright © 2008 Mikko Rasa, Mikkosoft Productions -Diestributed under the LGPL -*/ - -#include +#include #include "device.h" using namespace std; @@ -15,16 +8,21 @@ namespace AL { Device::Device() { - dev=alcOpenDevice(0); + dev = alcOpenDevice(0); if(!dev) - throw Exception("Couldn't get OpenAL device"); + throw runtime_error("Couldn't get OpenAL device"); } Device::Device(const string &spec) { - dev=alcOpenDevice(spec.c_str()); + dev = alcOpenDevice(spec.c_str()); if(!dev) - throw Exception("Couldn't get OpenAL device"); + throw runtime_error("Couldn't get OpenAL device"); +} + +Device::~Device() +{ + alcCloseDevice(dev); } } // namespace AL