From 3506d3df9f2e929def5b1662e08481d28643358f Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Mon, 17 May 2010 16:34:05 +0200 Subject: Added stride and colors to BulletPattern. --- bulletpattern.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bulletpattern.cpp') diff --git a/bulletpattern.cpp b/bulletpattern.cpp index 1e8da5e..a2504f9 100644 --- a/bulletpattern.cpp +++ b/bulletpattern.cpp @@ -7,7 +7,8 @@ #include "bulletpattern.h" BulletPattern::BulletPattern() { - num_bullets = 0; + num_bullets = stride = color_g = color_b = 0; + color_r = 1; bullets = new float[2048]; int k = 0; @@ -33,10 +34,10 @@ void BulletPattern::update(unsigned int time, unsigned int step) { void BulletPattern::draw() { glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(4, GL_FLOAT, 4 * sizeof(float), bullets); + glVertexPointer(4, GL_FLOAT, 4 * sizeof(float) + stride, bullets); glDrawArrays(GL_POINTS, 0, num_bullets); glDisableClientState(GL_VERTEX_ARRAY); -} \ No newline at end of file +} -- cgit v1.2.3