]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture.cpp
Rework exceptions
[libs/gl.git] / source / texture.cpp
index f4e7d705d142332652396160bb144009aa6c0364..d22f189bdcad4cc0a3c0e2f7edb0d55f30c5adaf 100644 (file)
@@ -1,11 +1,5 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include "except.h"
+#include <msp/strings/format.h>
+#include "error.h"
 #include "texture.h"
 #include "texunit.h"
 
@@ -47,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()));
 }
 
 
@@ -153,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)
        {