* objects and avoid having duplicate textures loaded to GL.
*/
-class Texture::TextureImpl : public Mippleton<TextureImpl>
+class Texture::Impl : public Mippleton<Impl>
{
/**
* Construction is initialization.
*/
- explicit TextureImpl(const std::string& name) :
- Mippleton<TextureImpl>(name),
+ explicit Impl(const std::string& name) :
+ Mippleton<Impl>(name),
surface_(0),
width_(0),
height_(0),
// we want to know when the GL context is recreated
Dispatcher::instance().addHandler("video.context_recreated",
- boost::bind(&TextureImpl::contextRecreated, this, _1), this);
+ boost::bind(&Impl::contextRecreated, this, _1), this);
}
- ~TextureImpl()
+ ~Impl()
{
if (surface_)
{
{
SDL_Surface* surface;
- surface = IMG_Load(Texture::getPathToResource(getName()).c_str());
+ surface = IMG_Load(Texture::getPath(getName()).c_str());
if (!surface)
{
static GLuint globalObject_; ///< Global GL texture handle.
};
-GLuint Texture::TextureImpl::globalObject_ = 0;
+GLuint Texture::Impl::globalObject_ = 0;
Texture::Texture(const std::string& name) :
// pass through
- impl_(Texture::TextureImpl::retain(name), &Texture::TextureImpl::release)
-{}
+ impl_(Texture::Impl::retain(name), &Texture::Impl::release) {}
/**
void Texture::resetBind()
{
glBindTexture(GL_TEXTURE_2D, 0);
- TextureImpl::globalObject_ = 0;
+ Impl::globalObject_ = 0;
}
}
-std::string Texture::getPathToResource(const std::string& name)
+std::string Texture::getPath(const std::string& name)
{
- // TODO named texture resources must be png for now
- return Resource::getPathToResource("textures/" + name + ".png");
+ std::string path = Resource::getPath("textures/" + name + ".png");
+ return path;
}