]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Core.cc
library class revamped as manager, goodbye tilemap
[chaz/yoink] / src / Moof / Core.cc
index 90027307c081f4050411713d47e24e2bb57a5c87..190f4c8d4d3bd064735c2f07da709c926fb77ddf 100644 (file)
@@ -32,7 +32,6 @@
 #include <list>
 #include <string>
 
 #include <list>
 #include <string>
 
-#include <AL/alc.h>
 #include <SDL/SDL.h>
 #include "fastevents.h"
 
 #include <SDL/SDL.h>
 #include "fastevents.h"
 
@@ -368,9 +367,7 @@ class Backend_
 {
 public:
 
 {
 public:
 
-       Backend_() :
-               mAlDevice(0),
-               mAlContext(0)
+       Backend_()
        {
 #if defined(_WIN32) || defined(__WIN32__)
                if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0)
        {
 #if defined(_WIN32) || defined(__WIN32__)
                if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0)
@@ -397,31 +394,11 @@ public:
                        return; // fatal
                }
 
                        return; // fatal
                }
 
-               mAlDevice = alcOpenDevice(0);
-               mAlContext = alcCreateContext(mAlDevice, 0);
-               if (!mAlDevice || !mAlContext)
-               {
-                       const char* error = alcGetString(mAlDevice,alcGetError(mAlDevice));
-                       gError.init(Error::OPENAL_INIT, error);
-                       return;
-               }
-               else
-               {
-                       alcMakeContextCurrent(mAlContext);
-                       logInfo << "opened sound device `"
-                                        << alcGetString(mAlDevice, ALC_DEFAULT_DEVICE_SPECIFIER)
-                                        << "'" << std::endl;
-               }
-
                gError.init(Error::NONE);
        }
 
        ~Backend_()
        {
                gError.init(Error::NONE);
        }
 
        ~Backend_()
        {
-               alcMakeContextCurrent(0);
-               alcDestroyContext(mAlContext);
-               alcCloseDevice(mAlDevice);
-
                FE_Quit();
                SDL_Quit();
        }
                FE_Quit();
                SDL_Quit();
        }
@@ -443,17 +420,13 @@ public:
                }
        }
 
                }
        }
 
-       static bool check(Error& error)
+       static const Error& getError()
        {
        {
-               error = gError;
-               return error.code() == Error::NONE;
+               return gError;
        }
 
 private:
 
        }
 
 private:
 
-       ALCdevice*              mAlDevice;
-       ALCcontext*             mAlContext;
-
        static Error    gError;
        static int              gRetainCount;
        static BackendP gInstance;
        static Error    gError;
        static int              gRetainCount;
        static BackendP gInstance;
@@ -474,9 +447,14 @@ Backend::~Backend()
        Backend_::release();
 }
 
        Backend_::release();
 }
 
-bool Backend::check(Error& error)
+bool Backend::isInitialized()
+{
+       return getError().code() == Error::NONE;
+}
+
+const Error& Backend::getError()
 {
 {
-       return Backend_::check(error);
+       return Backend_::getError();
 }
 
 
 }
 
 
This page took 0.020646 seconds and 4 git commands to generate.