]> git.tdb.fi Git - libs/gl.git/blobdiff - source/geometrybuilder.h
Bind textures in the modern way when shaders are used
[libs/gl.git] / source / geometrybuilder.h
index a0538b5933fe163b6ef04085b1dedfc32e402385..40bcd13e6b37b504d3c22ad3780ccce7a9b521b1 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2011  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GL_GEOMETRYBUILDER_H_
 #define MSP_GL_GEOMETRYBUILDER_H_
 
@@ -20,22 +13,23 @@ public:
        enum TextureFit
        {
                STRETCH,
-               CUT,
+               CROP,
                WRAP
        };
 
 protected:
-       int tangent_attr;
-       int binormal_attr;
+       bool generate_tbn;
        TextureFit tex_fit;
 
        GeometryBuilder();
 
 public:
-       GeometryBuilder &tangent(unsigned);
-       GeometryBuilder &binormal(unsigned);
+       GeometryBuilder &tbn(bool = true);
        GeometryBuilder &texture_fit(TextureFit);
+protected:
+       void adjust_texture_scale(float &, float &, float, float) const;
 
+public:
        virtual void build(PrimitiveBuilder &) const = 0;
        void build(Mesh &) const;
 };