void clDrawer::Draw(clParticleSys& P)
int i = 0;
if(P.Particle_Count<1)
return;
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glTranslatef(P.Position.x,P.Position.y,P.Position.z);
for(i=0;i<P.Particle_Drawn;++i)
if((P.ParticleList[i]!= NULL) && (P.ParticleList[i]->Active==true)){
glPushMatrix();
glTranslatef(P.ParticleList[i]->Position.x,P.ParticleList[i]->Position.y,P.ParticleList[i]->Position.z);
glColor4f(P.ParticleList[i]->Color.x,P.ParticleList[i]->Color.y,
P.ParticleList[i]->Color.z, (P.MaxAge - P.ParticleList[i]->Age)/P.MaxAge);
glCallList(P.DisplayList);
glPopMatrix();
};
glPopMatrix();
};
the profiler says that most of the time is lost in this section of the program...i don't know how to optimize everything =(
EDIT: i forgot: i create a displ.list ONCE at load time with a trianglestrip and every time i call that one
There aren't problems that can't be solved with a gun...