]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture.cpp
Rework exceptions
[libs/gl.git] / source / texture.cpp
index c2ea8ff7b854c95cf6bee17e5bfd43aed772f710..d22f189bdcad4cc0a3c0e2f7edb0d55f30c5adaf 100644 (file)
@@ -1,4 +1,5 @@
-#include "except.h"
+#include <msp/strings/format.h>
+#include "error.h"
 #include "texture.h"
 #include "texunit.h"
 
@@ -40,7 +41,7 @@ void operator>>(const LexicalConverter &c, TextureWrap &tw)
        else if(c.get()=="MIRRORED_REPEAT")
                tw = MIRRORED_REPEAT;
        else
-               throw LexicalError("Invalid input in TextureWrap conversion");
+               throw lexical_error(format("conversion of '%s' to TextureWrap", c.get()));
 }
 
 
@@ -146,9 +147,6 @@ void Texture::set_compare_func(Predicate f)
 
 void Texture::bind() const
 {
-       if(!target)
-               throw InvalidState("Attempt to bind a texture without target (should never happen)");
-
        const Texture *cur = TexUnit::current().get_texture();
        if(cur!=this)
        {