]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / texture.cpp
diff --git a/source/texture.cpp b/source/texture.cpp
deleted file mode 100644 (file)
index c367397..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#include <msp/core/error.h>
-#include "texture.h"
-#include "texunit.h"
-
-namespace Msp {
-namespace GL {
-
-void Texture::bind() const
-{
-       if(!target)
-               throw InvalidState("Attempt to bind a texture without target");
-
-       const Texture *cur=TexUnit::current().get_texture();
-       if(cur && cur->target!=target)
-               glDisable(cur->target);
-       if(!cur || cur->target!=target)
-               glEnable(target);
-       glBindTexture(target, id);
-       TexUnit::current().set_texture(this);
-}
-
-void Texture::parameter(GLenum param, int value)
-{
-       maybe_bind();
-
-       glTexParameteri(target, param, value);
-}
-
-void Texture::parameter(GLenum param, float value)
-{
-       maybe_bind();
-
-       glTexParameterf(target, param, value);
-}
-
-Texture::~Texture()
-{
-       glDeleteTextures(1, &id);
-}
-
-void Texture::unbind()
-{
-       const Texture *cur=TexUnit::current().get_texture();
-       if(!cur)
-               return;
-
-       glBindTexture(cur->target, 0);
-       glDisable(cur->target);
-       TexUnit::current().set_texture(0);
-}
-
-Texture::Texture():
-       target(0)
-{
-       glGenTextures(1, &id);
-}
-
-void Texture::maybe_bind() const
-{
-       if(TexUnit::current().get_texture()!=this)
-               bind();
-}
-
-} // namespace GL
-} // namespace Msp