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