added pushattrib/popattrib in the point rendering code of gl trimesh wrapper
This commit is contained in:
parent
bdc74ae3b4
commit
c095f8efe6
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue