added pushattrib/popattrib in the point rendering code of gl trimesh wrapper

This commit is contained in:
Paolo Cignoni 2010-04-20 01:01:13 +00:00
parent bdc74ae3b4
commit c095f8efe6
1 changed files with 23 additions and 22 deletions

View File

@ -721,6 +721,7 @@ double CameraDistance(){
template<NormalMode nm, ColorMode cm>
void DrawPoints()
{
glPushAttrib(GL_ENABLE_BIT | GL_POINT_BIT);
glPointSize(GetHintParamf(HNPPointSize));
if (glPointParameterfv) {
@ -734,9 +735,9 @@ void DrawPoints()
if(m->vn!=(int)m->vert.size())
{
DrawPointsBase<nm,cm>();
return;
}
else
{
// Perfect case, no deleted stuff,
// draw the vertices using vertex arrays
if (nm==NMPerVert)
@ -753,13 +754,13 @@ void DrawPoints()
glEnableClientState (GL_VERTEX_ARRAY);
glVertexPointer(3,GL_FLOAT,sizeof(typename MESH_TYPE::VertexType),&(m->vert.begin()->P()[0]));
//glDrawElements(GL_POINTS ,m->vn,GL_UNSIGNED_INT, &(*indices.begin()) );
glDrawArrays(GL_POINTS,0,m->vn);
glDisableClientState (GL_VERTEX_ARRAY);
if (nm==NMPerVert) glDisableClientState (GL_NORMAL_ARRAY);
if (cm==CMPerVert) glDisableClientState (GL_COLOR_ARRAY);
}
glPopAttrib();
return;
}