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/vertexarray.h
parent67517585e9b55967f5236ed5ebca77173eb2f2e3 (diff)
preparing for fragment rendering
Diffstat (limited to 'src/model/vertexarray.h')
-rw-r--r--src/model/vertexarray.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/model/vertexarray.h b/src/model/vertexarray.h
index 26d2514..6330d8c 100644
--- a/src/model/vertexarray.h
+++ b/src/model/vertexarray.h
@@ -15,6 +15,8 @@ namespace model {
const int SPHERESEGMENTS=65;
/// global vertex array
+/** a VertexArray acts like a stack of model vertices, it has no knowledge of what it is holding
+ */
class VertexArray
{
public:
@@ -24,9 +26,8 @@ public:
void clear();
- size_t add_vertex(math::Vector3f const &v, math::Vector3f const &n, math::Color const &color);
- size_t add_vertex(math::Vector3f const &v, math::Vector3f const &n, math::Color const &color, math::Vector3f const &tex);
-
+ size_t add_vertex(math::Vector3f const &v, math::Vector3f const &n, math::Color const &color, float tex_x=0.0f, float tex_y=0.0f);
+
inline float *vertex() { return vertex_vertex; }
inline float *color() { return vertex_color; }
inline float *normal() { return vertex_normal; }
@@ -34,7 +35,10 @@ public:
inline bool overflow() const { return vertex_overflow; }
+ /// number of allocated floats
inline size_t size() const { return vertex_size; }
+
+ /// index to the top of the stack
inline size_t index() const { return vertex_index; }
static inline VertexArray *instance() { return vertex_instance; }
@@ -48,7 +52,7 @@ private:
size_t vertex_index;
size_t vertex_size;
-
+
void add_sphere();
static VertexArray *vertex_instance;