]> git.tdb.fi Git - libs/al.git/blobdiff - source/device.cpp
Initial revision
[libs/al.git] / source / device.cpp
diff --git a/source/device.cpp b/source/device.cpp
new file mode 100644 (file)
index 0000000..422b7ea
--- /dev/null
@@ -0,0 +1,31 @@
+/* $Id$
+
+This file is part of libmspal
+Copyright © 2008 Mikko Rasa, Mikkosoft Productions
+Diestributed under the LGPL
+*/
+
+#include <msp/core/except.h>
+#include "device.h"
+
+using namespace std;
+
+namespace Msp {
+namespace AL {
+
+Device::Device()
+{
+       dev=alcOpenDevice(0);
+       if(!dev)
+               throw Exception("Couldn't get OpenAL device");
+}
+
+Device::Device(const string &spec)
+{
+       dev=alcOpenDevice(spec.c_str());
+       if(!dev)
+               throw Exception("Couldn't get OpenAL device");
+}
+
+} // namespace AL
+} // namespace Msp