PDA

View Full Version : Pointsprites using glDrawElements



kts
03-26-2005, 12:01 AM
I am using GL_POINT_SPRITE_ARB. But its strange: in immediate mode they are drawn a lot faster than eg with glDrawElements or glDrawArrays.

immediate:


glEnable( GL_POINT_SPRITE_ARB );
glBegin(GL_POINTS);

for (int ic = 0; ic < ipartc; ic++)
glVertex3f( partc[ic].vecPos.x, partc[ic].vecPos.y, partc[ic].vecPos.z);

glEnd();
glDisable( GL_POINT_SPRITE_ARB );glDrawElements / glDrawArrays:



glEnable( GL_POINT_SPRITE_ARB );
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, arpartc);

//glDrawElements(GL_POINTS, ia, GL_UNSIGNED_INT, arindex);

glDrawArrays(GL_POINTS, 0, ia);

glDisableClientState(GL_VERTEX_ARRAY);
glDisable( GL_POINT_SPRITE_ARB );help :p