#include <list>
#include <string>
+#include <AL/alc.h>
#include <SDL/SDL.h>
#include "fastevents.h"
-#include <AL/alut.h>
+
#include "Engine.hh"
#include "Event.hh"
const char* error = SDL_GetError();
throw Exception(ErrorCode::SDL_INIT, error);
}
+
if (FE_Init() != 0)
{
const char* error = FE_GetError();
throw Exception(ErrorCode::FASTEVENTS_INIT, error);
}
- int argc = 1;
- char name[] = "hello";
- alutInit(&argc, (char**)&name);
-
+
+ mAlDevice = alcOpenDevice(0);
+ mAlContext = alcCreateContext(mAlDevice, 0);
+ if (!mAlDevice || !mAlContext)
+ {
+ const char* error = alcGetString(mAlDevice,alcGetError(mAlDevice));
+ logError("error while creating audio context: %s", error);
+ }
+ else
+ {
+ alcMakeContextCurrent(mAlContext);
+ logDebug("opened sound device \"%s\"",
+ alcGetString(mAlDevice, ALC_DEFAULT_DEVICE_SPECIFIER));
+ }
+
// now load the settings the engine needs
Settings& settings = Settings::getInstance();
// the video object must be destroyed before we can shutdown SDL
mVideo.reset();
- alutExit();
+ alcMakeContextCurrent(0);
+ alcDestroyContext(mAlContext);
+ alcCloseDevice(mAlDevice);
+
FE_Quit();
SDL_Quit();
}
VideoP mVideo;
Dispatch mDispatch;
+ ALCdevice* mAlDevice;
+ ALCcontext* mAlContext;
+
std::list<LayerP> mStack;
std::list<LayerP>::iterator mStackIt;