* Bind the GL texture for mapping, etc.
*/
-void Texture::bind()
+void Texture::bind() const
{
// pass through
impl_->bind();
* Get the texture object, for the curious.
*/
-GLuint Texture::getObject()
+GLuint Texture::getObject() const
{
// pass through
return impl_->object_;
}
-unsigned Texture::getWidth()
+void Texture::resetBind()
+{
+ glBindTexture(GL_TEXTURE_2D, 0);
+ TextureImpl::globalObject_ = 0;
+}
+
+
+unsigned Texture::getWidth() const
{
// pass through
return impl_->width_;
}
-unsigned Texture::getHeight()
+unsigned Texture::getHeight() const
{
// pass through
return impl_->height_;
std::string Texture::getPathToResource(const std::string& name)
{
- // TODO named resources must be png for now
+ // TODO named texture resources must be png for now
return Resource::getPathToResource("textures/" + name + ".png");
}