]> git.tdb.fi Git - libs/al.git/blob - source/context.cpp
Add Streamer class
[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 Context::~Context()
25 {
26         alcDestroyContext(context);
27 }
28
29 } // namespace AL
30 } // namespace Msp