]> git.tdb.fi Git - libs/al.git/blob - source/device.cpp
1500100cf66a8ef0945e262df4e3dcecb4a70dc8
[libs/al.git] / source / device.cpp
1 /* $Id$
2
3 This file is part of libmspal
4 Copyright © 2008 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #include <msp/core/except.h>
9 #include "device.h"
10
11 using namespace std;
12
13 namespace Msp {
14 namespace AL {
15
16 Device::Device()
17 {
18         dev=alcOpenDevice(0);
19         if(!dev)
20                 throw Exception("Couldn't get OpenAL device");
21 }
22
23 Device::Device(const string &spec)
24 {
25         dev=alcOpenDevice(spec.c_str());
26         if(!dev)
27                 throw Exception("Couldn't get OpenAL device");
28 }
29
30 } // namespace AL
31 } // namespace Msp