summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <idr@freedesktop.org>2010-10-02 13:16:21 -0700
committerIan Romanick <idr@freedesktop.org>2010-10-02 14:58:38 -0700
commit7dd9d08b1e9eec07a050b12144ea74ad02aa6a6d (patch)
tree6d3885814135c2a209e288566abfb6bcd6899f24 /src
parentfbb781a415ac83b14c107061939977bf2b79368e (diff)
GLUshape: Pass element count as a parameter to begin_primitive method
Diffstat (limited to 'src')
-rw-r--r--src/cube.cpp2
-rw-r--r--src/mesh.c2
-rw-r--r--src/mesh.h2
-rw-r--r--src/sphere.cpp8
4 files changed, 7 insertions, 7 deletions
diff --git a/src/cube.cpp b/src/cube.cpp
index 39361f7..6b8d601 100644
--- a/src/cube.cpp
+++ b/src/cube.cpp
@@ -183,7 +183,7 @@ GLUcubeProducer::generate(GLUshapeConsumer *consumer) const
CB_BUFFER_MAKE_EMPTY(buf);
}
- consumer->begin_primitive(GL_TRIANGLES);
+ consumer->begin_primitive(GL_TRIANGLES, Elements(elts));
for (unsigned i = 0; i < Elements(elts); i++)
consumer->index(elts[i]);
diff --git a/src/mesh.c b/src/mesh.c
index 9082834..c5b5a13 100644
--- a/src/mesh.c
+++ b/src/mesh.c
@@ -33,7 +33,7 @@ generate_triangle_mesh(unsigned rows, unsigned cols, unsigned width,
int i;
int j;
- (*begin_cb)(data, GL_TRIANGLE_STRIP);
+ (*begin_cb)(data, GL_TRIANGLE_STRIP, rows * ((2 * cols) + 1));
for (i = 0; i < rows; i++) {
if ((i & 1) == 0) {
for (j = 0; j < cols; j++) {
diff --git a/src/mesh.h b/src/mesh.h
index 41cbbba..c31554c 100644
--- a/src/mesh.h
+++ b/src/mesh.h
@@ -27,7 +27,7 @@
extern "C" {
#endif
-typedef void (mesh_begin_cb)(void *data, GLenum mode);
+typedef void (mesh_begin_cb)(void *data, GLenum mode, unsigned count);
typedef void (mesh_index_cb)(void *data, unsigned index);
typedef void (mesh_end_cb)(void *data);
diff --git a/src/sphere.cpp b/src/sphere.cpp
index be8bf70..896f8d8 100644
--- a/src/sphere.cpp
+++ b/src/sphere.cpp
@@ -34,7 +34,7 @@ static void sphere_revolve_cb(void *data,
const GLUvec4 *tangent,
const GLUvec4 *uv);
-static void sphere_begin_cb(void *data, GLenum mode);
+static void sphere_begin_cb(void *data, GLenum mode, unsigned count);
static void sphere_index_cb(void *data, unsigned index);
@@ -67,7 +67,7 @@ class GLUconsumerFriend : public GLUshapeConsumer {
const GLUvec4 *tangent,
const GLUvec4 *uv);
- friend void sphere_begin_cb(void *data, GLenum mode);
+ friend void sphere_begin_cb(void *data, GLenum mode, unsigned count);
friend void sphere_index_cb(void *data, unsigned index);
@@ -123,11 +123,11 @@ sphere_revolve_cb(void *data, const GLUvec4 *position, const GLUvec4 *normal,
static void
-sphere_begin_cb(void *data, GLenum mode)
+sphere_begin_cb(void *data, GLenum mode, unsigned count)
{
GLUconsumerFriend *c = (GLUconsumerFriend *) data;
- c->begin_primitive(mode);
+ c->begin_primitive(mode, count);
}