X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FTexture.cc;h=341b5598f13f9b8c7d42f93643f26ca3f4727568;hp=fc50cfadeffcc62535faae1cf80cee6e24ec2576;hb=c9e20ac06383b20ceb5404c9237e319c2e90d157;hpb=a31d65a998121df0651c57bfb68782e2a07d2e2f diff --git a/src/Moof/Texture.cc b/src/Moof/Texture.cc index fc50cfa..341b559 100644 --- a/src/Moof/Texture.cc +++ b/src/Moof/Texture.cc @@ -34,8 +34,9 @@ #include #include "Dispatcher.hh" +#include "Exception.hh" +#include "Library.hh" #include "Log.hh" -#include "Mippleton.hh" #include "OpenGL.hh" #include "Texture.hh" @@ -52,7 +53,7 @@ namespace Mf { * objects and avoid having duplicate textures loaded to GL. */ -class Texture::Impl : public Mippleton +class Texture::Impl : public Library { /** @@ -131,7 +132,7 @@ public: */ explicit Impl(const std::string& name) : - Mippleton(name), + Library(name), mContext(0), mWidth(0), mHeight(0), @@ -245,7 +246,7 @@ public: if (!surface) { logWarning("texture not found: %s", getName().c_str()); - throw Exception(Exception::FILE_NOT_FOUND); + throw Exception(ErrorCode::FILE_NOT_FOUND, getName().c_str()); } SDL_Surface* temp = prepareImageForGL(surface); @@ -253,7 +254,7 @@ public: if (!temp) { - throw Exception(Exception::OPENGL_ERROR); + throw Exception(ErrorCode::UNKNOWN_IMAGE_FORMAT); } if (temp->format->BytesPerPixel == 3) @@ -267,7 +268,7 @@ public: else { SDL_FreeSurface(temp); - throw Exception(Exception::BAD_IMAGE_FORMAT); + throw Exception(ErrorCode::UNKNOWN_IMAGE_FORMAT); } mWidth = temp->w; @@ -296,10 +297,12 @@ public: glBindTexture(GL_TEXTURE_2D, mObject); glTexImage2D + //gluBuild2DMipmaps ( GL_TEXTURE_2D, 0, mMode, + //3, mContext->w, mContext->h, 0,