Rev 13 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
/*
* trail.cc
* DIN Is Noise is copyright (c) 2006-2017 Jagannathan Sampath
* For more information, please visit http://dinisnoise.org/
*/
#include "dingl.h"
#include "trail.h"
void trail_t::draw () {
if (n_tpts < num_points) {
if (tpts) delete[] tpts;
tpts = new float [2 * num_points];
n_tpts = num_points;
}
int m = 0, n = 0;
for (typename std::list< point<float> >::iterator iter = tq.begin (), jter = tq.end (); iter != jter; ++iter) {
point<float>& p = *iter;
tpts[m++] = p.x; tpts[m++]=p.y;
++n;
}
glVertexPointer (2, GL_FLOAT, 0, tpts);
glDrawArrays (GL_LINE_STRIP, 0, n);
}