From 5c809dc701be62fbabfc7e3e82449b3bfa051972 Mon Sep 17 00:00:00 2001 From: granzuglia Date: Thu, 28 Aug 2014 08:59:24 +0000 Subject: [PATCH] - renamed GL_TYPE with GL_TYPE_NM in order to avoid names conflict --- wrap/gl/pick.h | 4 ++-- wrap/gl/trimesh.h | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/wrap/gl/pick.h b/wrap/gl/pick.h index 8d39b8b5..8edd4336 100644 --- a/wrap/gl/pick.h +++ b/wrap/gl/pick.h @@ -211,11 +211,11 @@ public: int screenW = (int)(vp[2]-vp[0]); int screenH = (int)(vp[3]-vp[1]); - GL_TYPE::ScalarType *buffer = new GL_TYPE::ScalarType[screenW*screenH]; + GL_TYPE_NM::ScalarType *buffer = new GL_TYPE_NM::ScalarType[screenW*screenH]; //I'm not sure glReadPixels can accept GL_DOUBLE tag //GLenum err = glGetError(); - glReadPixels(vp[0],vp[1],vp[2],vp[3],GL_DEPTH_COMPONENT,GL_TYPE::SCALAR(),buffer); + glReadPixels(vp[0],vp[1],vp[2],vp[3],GL_DEPTH_COMPONENT,GL_TYPE_NM::SCALAR(),buffer); //err = glGetError(); std::vector result; PickFace(x,y,m,result,width,height); diff --git a/wrap/gl/trimesh.h b/wrap/gl/trimesh.h index aa200f99..5821cf27 100644 --- a/wrap/gl/trimesh.h +++ b/wrap/gl/trimesh.h @@ -35,16 +35,16 @@ namespace vcg { template -class GL_TYPE +class GL_TYPE_NM {public: static GLenum SCALAR() { assert(0); return 0;} }; -template <> class GL_TYPE +template <> class GL_TYPE_NM { public: typedef GLfloat ScalarType; static GLenum SCALAR() { return GL_FLOAT; } }; -template <> class GL_TYPE +template <> class GL_TYPE_NM {public: typedef GLdouble ScalarType; static GLenum SCALAR() { return GL_DOUBLE; } @@ -234,8 +234,8 @@ void Update(/*Change c=CHAll*/) (char *)&(m->vert[0].N()), GL_STATIC_DRAW_ARB); } - glVertexPointer(3,GL_TYPE::SCALAR(),sizeof(VertexType),0); - glNormalPointer(GL_TYPE::SCALAR(),sizeof(VertexType),0); + glVertexPointer(3,GL_TYPE_NM::SCALAR(),sizeof(VertexType),0); + glNormalPointer(GL_TYPE_NM::SCALAR(),sizeof(VertexType),0); } //int C=c; @@ -377,10 +377,10 @@ void DrawFill() if (nm==NMPerVert) { glBindBuffer(GL_ARRAY_BUFFER,array_buffers[1]); - glNormalPointer(GL_TYPE::SCALAR(),sizeof(typename MeshType::VertexType),0); + glNormalPointer(GL_TYPE_NM::SCALAR(),sizeof(typename MeshType::VertexType),0); } glBindBuffer(GL_ARRAY_BUFFER,array_buffers[0]); - glVertexPointer(3,GL_TYPE::SCALAR(),sizeof(typename MeshType::VertexType),0); + glVertexPointer(3,GL_TYPE_NM::SCALAR(),sizeof(typename MeshType::VertexType),0); glDrawElements(GL_TRIANGLES ,m->fn*3,GL_UNSIGNED_INT, &(*indices.begin()) ); glDisableClientState (GL_VERTEX_ARRAY); @@ -403,8 +403,8 @@ void DrawFill() glEnableClientState (GL_VERTEX_ARRAY); if (nm==NMPerVert) - glNormalPointer(GL_TYPE::SCALAR(),sizeof(typename MeshType::VertexType),&(m->vert.begin()->N()[0])); - glVertexPointer(3,GL_TYPE::SCALAR(),sizeof(typename MeshType::VertexType),&(m->vert.begin()->P()[0])); + glNormalPointer(GL_TYPE_NM::SCALAR(),sizeof(typename MeshType::VertexType),&(m->vert.begin()->N()[0])); + glVertexPointer(3,GL_TYPE_NM::SCALAR(),sizeof(typename MeshType::VertexType),&(m->vert.begin()->P()[0])); glDrawElements(GL_TRIANGLES ,m->fn*3,GL_UNSIGNED_INT, &(*indices.begin()) ); glDisableClientState (GL_VERTEX_ARRAY); @@ -686,7 +686,7 @@ void DrawPoints() if (nm==NMPerVert) { glEnableClientState (GL_NORMAL_ARRAY); - glNormalPointer(GL_TYPE::SCALAR(),sizeof(VertexType),&(m->vert.begin()->N()[0])); + glNormalPointer(GL_TYPE_NM::SCALAR(),sizeof(VertexType),&(m->vert.begin()->N()[0])); } if (cm==CMPerVert) { @@ -695,7 +695,7 @@ void DrawPoints() } glEnableClientState (GL_VERTEX_ARRAY); - glVertexPointer(3,GL_TYPE::SCALAR(),sizeof(VertexType),&(m->vert.begin()->P()[0])); + glVertexPointer(3,GL_TYPE_NM::SCALAR(),sizeof(VertexType),&(m->vert.begin()->P()[0])); glDrawArrays(GL_POINTS,0,m->vn);