X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FTexture.cc;h=b778c1ccde0299b1e306d33724457728c563d65a;hp=46dbb480afc3fc179f06b2db8192ac5b421c0735;hb=7e898e8ec0ff716e2fc722b883a626a6c346f107;hpb=a5f0d391406a68275b41448fc3f49e8d8396c497 diff --git a/src/Moof/Texture.cc b/src/Moof/Texture.cc index 46dbb48..b778c1c 100644 --- a/src/Moof/Texture.cc +++ b/src/Moof/Texture.cc @@ -34,11 +34,11 @@ #include #include "Dispatcher.hh" +#include "Log.hh" #include "Mippleton.hh" #include "OpenGL.hh" #include "Texture.hh" -#include namespace Mf { @@ -81,7 +81,6 @@ class Texture::Impl : public Mippleton void contextRecreated(const Notification* note) { - std::cout << "context recrated!" << std::endl; object_ = globalObject_ = 0; uploadToGL(); } @@ -245,7 +244,8 @@ public: if (!surface) { - throw Texture::Exception("loading from file failed"); + logWarning("texture not found: %s", getName().c_str()); + throw Exception(Exception::FILE_NOT_FOUND); } SDL_Surface* temp = prepareImageForGL(surface); @@ -253,7 +253,7 @@ public: if (!temp) { - throw Texture::Exception("uploading to opengl failed"); + throw Exception(Exception::OPENGL_ERROR); } if (temp->format->BytesPerPixel == 3) @@ -267,7 +267,7 @@ public: else { SDL_FreeSurface(temp); - throw Texture::Exception("incompatible color mode"); + throw Exception(Exception::BAD_IMAGE_FORMAT); } width_ = temp->w; @@ -390,7 +390,7 @@ GLuint Texture::Impl::globalObject_ = 0; Texture::Texture(const std::string& name) : // pass through - impl_(Texture::Impl::retain(name), &Texture::Impl::release) {} + impl_(Texture::Impl::getInstance(name)) {} /**