]> git.tdb.fi Git - libs/al.git/blob - source/context.cpp
1ca0eac92d3d6a6b6f88fcbb7dac054395152a92
[libs/al.git] / source / context.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 "context.h"
10 #include "device.h"
11
12 namespace Msp {
13 namespace AL {
14
15 Context::Context(Device &dev)
16 {
17         context=alcCreateContext(dev.get_device(), 0);
18         if(!context)
19                 throw Exception("Couldn't create OpenAL context");
20
21         alcMakeContextCurrent(context);
22 }
23
24 } // namespace AL
25 } // namespace Msp