X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcontext.cpp;h=4c9b77cd23300bbbaefbf805057b012095ac227e;hb=HEAD;hp=1ca0eac92d3d6a6b6f88fcbb7dac054395152a92;hpb=8e69eba7dc53233c169152bdf654f032fcd0629f;p=libs%2Fal.git diff --git a/source/context.cpp b/source/context.cpp index 1ca0eac..4c9b77c 100644 --- a/source/context.cpp +++ b/source/context.cpp @@ -1,11 +1,4 @@ -/* $Id$ - -This file is part of libmspal -Copyright © 2008 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#include +#include #include "context.h" #include "device.h" @@ -14,12 +7,17 @@ namespace AL { Context::Context(Device &dev) { - context=alcCreateContext(dev.get_device(), 0); + context = alcCreateContext(dev.get_device(), 0); if(!context) - throw Exception("Couldn't create OpenAL context"); + throw std::runtime_error("Couldn't create OpenAL context"); alcMakeContextCurrent(context); } +Context::~Context() +{ + alcDestroyContext(context); +} + } // namespace AL } // namespace Msp