]> git.tdb.fi Git - libs/gl.git/blobdiff - source/geometrybuilder.h
Add classes for building some geometric shapes
[libs/gl.git] / source / geometrybuilder.h
diff --git a/source/geometrybuilder.h b/source/geometrybuilder.h
new file mode 100644 (file)
index 0000000..a0538b5
--- /dev/null
@@ -0,0 +1,46 @@
+/* $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_
+
+namespace Msp {
+namespace GL {
+
+class Mesh;
+class PrimitiveBuilder;
+
+class GeometryBuilder
+{
+public:
+       enum TextureFit
+       {
+               STRETCH,
+               CUT,
+               WRAP
+       };
+
+protected:
+       int tangent_attr;
+       int binormal_attr;
+       TextureFit tex_fit;
+
+       GeometryBuilder();
+
+public:
+       GeometryBuilder &tangent(unsigned);
+       GeometryBuilder &binormal(unsigned);
+       GeometryBuilder &texture_fit(TextureFit);
+
+       virtual void build(PrimitiveBuilder &) const = 0;
+       void build(Mesh &) const;
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif