]> git.tdb.fi Git - libs/al.git/blobdiff - source/device.cpp
Use standard exception classes
[libs/al.git] / source / device.cpp
index 422b7ea2f8e055970c6ba9d6d9297c60a0f95e58..c866b32f704e620c5c331dc6b34182e84e6b8f48 100644 (file)
@@ -1,11 +1,4 @@
-/* $Id$
-
-This file is part of libmspal
-Copyright © 2008 Mikko Rasa, Mikkosoft Productions
-Diestributed under the LGPL
-*/
-
-#include <msp/core/except.h>
+#include <stdexcept>
 #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