Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-07-23 15:16:56 +0000
committerStijn Buys <ingar@osirion.org>2008-07-23 15:16:56 +0000
commit426b766efbccdd8f5715de9526464db251fac30c (patch)
treef1abfea7c1d4d4f1e97bd534d447cb6907576e2f /src/model/primitives.h
parent67517585e9b55967f5236ed5ebca77173eb2f2e3 (diff)
preparing for fragment rendering
Diffstat (limited to 'src/model/primitives.h')
-rw-r--r--src/model/primitives.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/model/primitives.h b/src/model/primitives.h
new file mode 100644
index 0000000..28da706
--- /dev/null
+++ b/src/model/primitives.h
@@ -0,0 +1,44 @@
+/*
+ model/primitives.h
+ This file is part of the Osirion project and is distributed under
+ the terms of the GNU General Public License version 2
+*/
+
+#ifndef __INCLUDED_MODEL_PRIMITIVES_H__
+#define __INCLUDED_MODEL_PRIMITIVES_H__
+
+#include "math/vector3f.h"
+#include "math/color.h"
+#include "model/triangle.h"
+#include "model/quad.h"
+
+namespace model
+{
+
+/// a list of Triangle and Quad primitives that have to be rendered using the same material, to be parsed into fragments
+class Primitives
+{
+public:
+ Primitives(unsigned int material);
+ ~Primitives();
+
+ /// the material to be used for these primitives
+ inline unsigned int material() const { return primitives_material; }
+
+ /// add a Triangle primitive
+ void add_triangle(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2,
+ math::Vector3f const &normal, math::Color const &color, bool detail);
+
+ /// add a Quad primitive
+ void add_quad(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2, math::Vector3f const &v3,
+ math::Vector3f const &normal, math::Color const &color, bool detail);
+
+private:
+ std::list<Triangle *> primitives_triangles;
+ std::list<Quad *> primitives_quads;
+
+ unsigned int primitives_material;
+};
+
+}
+#endif