]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Texture.cc
refactoring needed for win32 crash
[chaz/yoink] / src / Moof / Texture.cc
index 22d3f15e92cab597259673d86c08cd2f4692d292..5341af33d32085632d605029705fa21b4d1c3b7e 100644 (file)
 #include <boost/bind.hpp>
 
 #include "Dispatch.hh"
-#include "Engine.hh"
-#include "Exception.hh"
+#include "Core.hh"
+#include "Error.hh"
 #include "Image.hh"
 #include "Library.hh"
 #include "Log.hh"
 #include "OpenGL.hh"
 #include "Texture.hh"
+#include "Video.hh"
 
 
 namespace Mf {
@@ -121,13 +122,11 @@ public:
                mWrapT(GL_CLAMP),
                mObject(0)
        {
-               // make sure the engine is initialized
-               Engine& engine = Engine::getInstance();
-               VideoP video = engine.getVideo();
-               ASSERT(video && "cannot load textures without a current video context");
+               // make sure we have a video context
+               //ASSERT(video && "cannot load textures without a current video context");
 
                // we want to know when the GL context is recreated
-               mDispatchHandler = engine.addHandler("video.newcontext",
+               mDispatchHandler = core.addHandler("video.newcontext",
                                boost::bind(&Impl::contextRecreated, this));
 
                loadFromFile();
@@ -220,7 +219,7 @@ public:
                if (!mImage.isValid())
                {
                        logWarning << "texture not found: " << getName() << std::endl;
-                       throw Exception(ErrorCode::RESOURCE_NOT_FOUND, getName());
+                       throw Error(Error::RESOURCE_NOT_FOUND, getName());
                }
 
                mImage.flip();
This page took 0.01733 seconds and 4 git commands to generate.