diff options
Diffstat (limited to 'bulletpattern.cpp')
-rw-r--r-- | bulletpattern.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/bulletpattern.cpp b/bulletpattern.cpp deleted file mode 100644 index b4b5a31..0000000 --- a/bulletpattern.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef __APPLE__ -#include <GL/gl.h> -#else -#include <OpenGL/gl.h> -#endif -#include <cmath> -#include "bulletpattern.h" - -BulletPattern::BulletPattern() { - num_bullets = stride = color_g = color_b = 0; - color_r = 1; - bullets = new float[2048]; - - int k = 0; - - for(float i = 0; i < M_PI * 16; i += 0.1) { - bullets[k++] = 0.5 + cosf(i) * 0.05; - bullets[k++] = 0.5 + sinf(i) * 0.05; - bullets[k++] = cosf(i) / 10000.0; - bullets[k++] = sinf(i) / 10000.0; - } -} - -void BulletPattern::update(unsigned int time, unsigned int step) { - while(num_bullets < 503 && num_bullets * 4 < time) { - num_bullets++; - } - for(int i = 0; i < num_bullets; i++) { - bullets[i*4] += bullets[i*4 + 2] * step; - bullets[i*4 + 1] += bullets[i*4 + 3] * step; - } -} - -void BulletPattern::draw() { - glEnableClientState(GL_VERTEX_ARRAY); - - glVertexPointer(4, GL_FLOAT, 4 * sizeof(float) + stride, bullets); - - glDrawArrays(GL_POINTS, 0, num_bullets); - - glDisableClientState(GL_VERTEX_ARRAY); - -} |