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 19:51:06 +0000
committerStijn Buys <ingar@osirion.org>2008-07-23 19:51:06 +0000
commit5c96b74c76b881b1533432a75d1a8cc42ecc5bda (patch)
treea1500e0149ba03d017dd5fdb169a6538a7a06a61 /src/model/fragment.h
parent1cf82068a2adff7c401fe0aba73466f045e460d3 (diff)
fragment renderer
Diffstat (limited to 'src/model/fragment.h')
-rw-r--r--src/model/fragment.h44
1 files changed, 31 insertions, 13 deletions
diff --git a/src/model/fragment.h b/src/model/fragment.h
index ba4eaf9..0df1b79 100644
--- a/src/model/fragment.h
+++ b/src/model/fragment.h
@@ -19,28 +19,46 @@ class Fragment
public:
/// fragment primitive type: triangles or quads
enum Type {Triangles, Quads};
-
+
/// create a new fragment
- Fragment (Type type, unsigned int material);
-
+ Fragment(Type type, unsigned int material);
+
/// add a vertex to the fragment
size_t add_vertex(math::Vector3f const & vertex, math::Vector3f const &normal, math::Color const & color, bool detail);
-
+
+ /// the type of primitives this fragment consists of
+ inline Type type() const
+ {
+ return fragment_type;
+ }
+
/// VertexArray index of the start of the fragment
- inline size_t start() const { return fragment_start; }
-
+ inline size_t index() const
+ {
+ return fragment_index;
+ }
+
/// number of structural vertices in the fragment
- inline size_t structural_size() const { return fragment_structural_size; }
-
+ inline size_t structural_size() const
+ {
+ return fragment_structural_size;
+ }
+
/// number of detail vertices in the fragment
- inline size_t detail_size() const { return fragment_detail_size; }
-
+ inline size_t detail_size() const
+ {
+ return fragment_detail_size;
+ }
+
/// material flags
- inline unsigned int material() { return fragment_material; }
-
+ inline unsigned int material()
+ {
+ return fragment_material;
+ }
+
private:
Type fragment_type;
- size_t fragment_start;
+ size_t fragment_index;
size_t fragment_structural_size;
size_t fragment_detail_size;
unsigned int fragment_material;