Commit b833e0e7 authored by Sylvain Thery's avatar Sylvain Thery

Changement rendu

ajout class VBO
ajout QT
etc.
parent 1fd88af9
...@@ -36,6 +36,7 @@ add_executable( Geom_inclusionD ./Geom_inclusion.cpp) ...@@ -36,6 +36,7 @@ add_executable( Geom_inclusionD ./Geom_inclusion.cpp)
target_link_libraries( Geom_inclusionD target_link_libraries( Geom_inclusionD
${COMMON_LIBS} ) ${COMMON_LIBS} )
add_executable( Algo_Geom_inclusionD ./Algo_Geom_inclusion.cpp)
target_link_libraries( Algo_Geom_inclusionD #add_executable( Algo_Geom_inclusionD ./Algo_Geom_inclusion.cpp)
containerD topologyD utilsD algoD ${COMMON_LIBS} ) #target_link_libraries( Algo_Geom_inclusionD
# containerD topologyD utilsD algoD ${COMMON_LIBS} )
...@@ -137,7 +137,7 @@ public: ...@@ -137,7 +137,7 @@ public:
*/ */
int renderStyle; int renderStyle;
Algo::Render::VBO::MapRender_VBO* m_render; Algo::Render::GL2::MapRender_VBO* m_render;
/** /**
* render mode enum * render mode enum
...@@ -152,14 +152,14 @@ public: ...@@ -152,14 +152,14 @@ public:
{ {
if (this->shaderOk) shaders[0].loadShaders("phong_vs.txt","phong_ps.txt"); if (this->shaderOk) shaders[0].loadShaders("phong_vs.txt","phong_ps.txt");
// m_cb = new Algo::Render::VBO::VBO_CB_PositionNormal<PFP>(myMap); // m_cb = new Algo::Render::GL2::GL2_CB_PositionNormal<PFP>(myMap);
// m_render = new Algo::Render::VBO::MapRender_VBO(myMap, allDarts, m_cb); // m_render = new Algo::Render::GL2::MapRender_VBO(myMap, allDarts, m_cb);
// //
// m_render->initBuffers(); // m_render->initBuffers();
// m_render->updateData(Algo::Render::VBO::POSITIONS, position ); // m_render->updateData(Algo::Render::GL2::POSITIONS, position );
// m_render->updateData(Algo::Render::VBO::NORMALS, normal ); // m_render->updateData(Algo::Render::GL2::NORMALS, normal );
// m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::TRIANGLES); // m_render->initPrimitives<PFP>(myMap, good, Algo::Render::GL2::TRIANGLES);
// m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::LINES); // m_render->initPrimitives<PFP>(myMap, good, Algo::Render::GL2::LINES);
} }
}; };
...@@ -186,12 +186,12 @@ void myGlutWin::myRedraw(void) ...@@ -186,12 +186,12 @@ void myGlutWin::myRedraw(void)
Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ; Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
// m_render->draw(Algo::Render::VBO::TRIANGLES); // m_render->draw(Algo::Render::GL2::TRIANGLES);
Algo::Render::Direct::renderTriQuadPoly<PFP>(myMap, Algo::Render::Direct::FLAT, 0.9 , position, normal, normal); Algo::Render::Direct::renderTriQuadPoly<PFP>(myMap, Algo::Render::Direct::FLAT, 0.9 , position, normal, normal);
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
glColor3f(0.0f,0.0f,0.0f); glColor3f(0.0f,0.0f,0.0f);
// m_render->draw(Algo::Render::VBO::LINES); // m_render->draw(Algo::Render::GL2::LINES);
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
Algo::Render::Direct::renderTriQuadPoly<PFP>(myMap, Algo::Render::Direct::LINE, 1.0, position, normal); Algo::Render::Direct::renderTriQuadPoly<PFP>(myMap, Algo::Render::Direct::LINE, 1.0, position, normal);
// glPointSize(5.0f); // glPointSize(5.0f);
...@@ -227,7 +227,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int) ...@@ -227,7 +227,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
position[it] += normal[it] * 0.1; position[it] += normal[it] * 0.1;
} }
m_render->updateData(Algo::Render::VBO::POSITIONS, position ); m_render->updateData(Algo::Render::GL2::POSITIONS, position );
} }
break; break;
...@@ -239,7 +239,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int) ...@@ -239,7 +239,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
normal[it] *= -1.0f; normal[it] *= -1.0f;
} }
m_render->updateData(Algo::Render::VBO::NORMALS, normal ); m_render->updateData(Algo::Render::GL2::NORMALS, normal );
} }
break; break;
......
...@@ -147,47 +147,47 @@ void MyGlutWin::myRedraw(void) ...@@ -147,47 +147,47 @@ void MyGlutWin::myRedraw(void)
if(render_obj) if(render_obj)
{ {
m_render->updateData(Algo::Render::VBO::POSITIONS, position ); m_render->updateData(Algo::Render::GL2::POSITIONS, position );
//m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::POINTS); //m_render->initPrimitives<PFP>(myMap, good, Algo::Render::GL2::POINTS);
if(renderObjStyle == O_ALL) if(renderObjStyle == O_ALL)
{ {
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::TRIANGLES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
glEnable( GL_POLYGON_OFFSET_FILL ); glEnable( GL_POLYGON_OFFSET_FILL );
glPolygonOffset( 1.0f, 1.0f ); glPolygonOffset( 1.0f, 1.0f );
glColor3f(0.0f,0.5f,0.0f); glColor3f(0.0f,0.5f,0.0f);
//shaders[3].bind(); //shaders[3].bind();
m_render->draw(Algo::Render::VBO::TRIANGLES); m_render->draw(Algo::Render::GL2::TRIANGLES);
//shaders[3].unbind(); //shaders[3].unbind();
glDisable( GL_POLYGON_OFFSET_FILL ); glDisable( GL_POLYGON_OFFSET_FILL );
// on trace les ligne devant // on trace les ligne devant
glColor3f(1.0f,1.0f,0.0f); glColor3f(1.0f,1.0f,0.0f);
m_render->draw(Algo::Render::VBO::LINES); m_render->draw(Algo::Render::GL2::LINES);
} }
else if(renderObjStyle == O_FACES) else if(renderObjStyle == O_FACES)
{ {
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::TRIANGLES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
glEnable( GL_POLYGON_OFFSET_FILL ); glEnable( GL_POLYGON_OFFSET_FILL );
glPolygonOffset( 1.0f, 1.0f ); glPolygonOffset( 1.0f, 1.0f );
glColor3f(0.0f,0.5f,0.0f); glColor3f(0.0f,0.5f,0.0f);
m_render->draw(Algo::Render::VBO::TRIANGLES); m_render->draw(Algo::Render::GL2::TRIANGLES);
glDisable( GL_POLYGON_OFFSET_FILL ); glDisable( GL_POLYGON_OFFSET_FILL );
} }
else if(renderObjStyle == O_LINE) else if(renderObjStyle == O_LINE)
{ {
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
// on trace les ligne devant // on trace les ligne devant
glDisable( GL_POLYGON_OFFSET_FILL ); glDisable( GL_POLYGON_OFFSET_FILL );
glColor3f(1.0f,1.0f,0.0f); glColor3f(1.0f,1.0f,0.0f);
m_render->draw(Algo::Render::VBO::LINES); m_render->draw(Algo::Render::GL2::LINES);
} }
else if(renderObjStyle == O_EXPLOD) else if(renderObjStyle == O_EXPLOD)
{ {
...@@ -271,14 +271,14 @@ void MyGlutWin::initRender() ...@@ -271,14 +271,14 @@ void MyGlutWin::initRender()
{ {
// maj des donnees de position // maj des donnees de position
GLint t1 = glutGet(GLUT_ELAPSED_TIME); GLint t1 = glutGet(GLUT_ELAPSED_TIME);
m_render->updateData(Algo::Render::VBO::POSITIONS, position ); m_render->updateData(Algo::Render::GL2::POSITIONS, position );
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "updateData: "<< seconds << "sec" << std::endl; std::cout << "updateData: "<< seconds << "sec" << std::endl;
// creation des primitives de rendu a partir de la carte // creation des primitives de rendu a partir de la carte
t1 = glutGet(GLUT_ELAPSED_TIME); t1 = glutGet(GLUT_ELAPSED_TIME);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::TRIANGLES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
t2 = glutGet(GLUT_ELAPSED_TIME); t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f; seconds = (t2 - t1) / 1000.0f;
std::cout << "initPrimitives: "<< seconds << "sec" << std::endl; std::cout << "initPrimitives: "<< seconds << "sec" << std::endl;
...@@ -414,9 +414,9 @@ int main(int argc, char **argv) ...@@ -414,9 +414,9 @@ int main(int argc, char **argv)
// allocation des objets necessaires pour le rendu // allocation des objets necessaires pour le rendu
mgw->m_render = new Algo::Render::VBO::MapRender_VBO(); mgw->m_render = new Algo::Render::GL2::MapRender_VBO();
//mgw->m_render_topo = new Algo::Render::VBO::topo3_VBORenderMap<PFP::MAP>(); //mgw->m_render_topo = new Algo::Render::GL2::topo3_VBORenderMap<PFP::MAP>();
mgw->m_render_topo = new Algo::Render::VBO::topo3_VBORenderMapD(); mgw->m_render_topo = new Algo::Render::GL2::topo3_VBORenderMapD();
mgw->init(); mgw->init();
mgw->initRender(); mgw->initRender();
......
...@@ -132,13 +132,13 @@ public: ...@@ -132,13 +132,13 @@ public:
/* /*
* VBO Object rendering * VBO Object rendering
*/ */
Algo::Render::VBO::MapRender_VBO* m_render; Algo::Render::GL2::MapRender_VBO* m_render;
/* /*
* VBO Topo rendering * VBO Topo rendering
*/ */
//Algo::Render::VBO::topo_MD3_VBORender<PFP>* m_render_topo; //Algo::Render::GL2::topo_MD3_VBORender<PFP>* m_render_topo;
Algo::Render::VBO::topo3_VBORenderMapD* m_render_topo; Algo::Render::GL2::topo3_VBORenderMapD* m_render_topo;
/* /*
* ALGO VARIABLES * ALGO VARIABLES
......
...@@ -95,7 +95,7 @@ public: ...@@ -95,7 +95,7 @@ public:
/** /**
* render object * render object
*/ */
Algo::Render::VBO::MapRender_VBO* m_render; Algo::Render::GL2::MapRender_VBO* m_render;
...@@ -134,14 +134,14 @@ void myGlutWin::updateRender() ...@@ -134,14 +134,14 @@ void myGlutWin::updateRender()
// create the renderer (first call only) // create the renderer (first call only)
if (m_render == NULL) if (m_render == NULL)
m_render = new Algo::Render::VBO::MapRender_VBO() ; m_render = new Algo::Render::GL2::MapRender_VBO() ;
// update buffer op vertices positions // update buffer op vertices positions
m_render->updateData(Algo::Render::VBO::POSITIONS, position); m_render->updateData(Algo::Render::GL2::POSITIONS, position);
// update flat faces primtives (warning need position buffer) // update flat faces primtives (warning need position buffer)
m_render->initPrimitives<PFP>(myMap, SelectorTrue(), Algo::Render::VBO::FLAT_TRIANGLES); m_render->initPrimitives<PFP>(myMap, SelectorTrue(), Algo::Render::GL2::FLAT_TRIANGLES);
// update lines primitives // update lines primitives
m_render->initPrimitives<PFP>(myMap, SelectorTrue(), Algo::Render::VBO::LINES); m_render->initPrimitives<PFP>(myMap, SelectorTrue(), Algo::Render::GL2::LINES);
} }
...@@ -159,7 +159,7 @@ void myGlutWin::myRedraw(void) ...@@ -159,7 +159,7 @@ void myGlutWin::myRedraw(void)
// DRAW LINES OF OBJECTS // DRAW LINES OF OBJECTS
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
glColor3f(1.0f,1.0f,0.0f); glColor3f(1.0f,1.0f,0.0f);
m_render->draw(Algo::Render::VBO::LINES) ; m_render->draw(Algo::Render::GL2::LINES) ;
//shit for nice line rendering //shit for nice line rendering
glEnable( GL_POLYGON_OFFSET_FILL ); glEnable( GL_POLYGON_OFFSET_FILL );
...@@ -170,7 +170,7 @@ void myGlutWin::myRedraw(void) ...@@ -170,7 +170,7 @@ void myGlutWin::myRedraw(void)
glEnable(GL_COLOR_MATERIAL); glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE); glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE);
glColor3f(0.0f,0.0f,0.9f); glColor3f(0.0f,0.0f,0.9f);
m_render->draw(Algo::Render::VBO::FLAT_TRIANGLES) ; m_render->draw(Algo::Render::GL2::FLAT_TRIANGLES) ;
glDisable( GL_POLYGON_OFFSET_FILL ); glDisable( GL_POLYGON_OFFSET_FILL );
......
...@@ -93,8 +93,8 @@ public: ...@@ -93,8 +93,8 @@ public:
PFP::TVEC3 normal ; PFP::TVEC3 normal ;
PFP::TVEC3 laplacian ; PFP::TVEC3 laplacian ;
Algo::Render::VBO::MapRender_VBO* vbo_render ; Algo::Render::GL2::MapRender_VBO* vbo_render ;
Algo::Render::VBO::topo_VBORenderMapD* topo_render ; Algo::Render::GL2::topo_VBORenderMapD* topo_render ;
GLuint dl_norm, dl_lapl ; GLuint dl_norm, dl_lapl ;
MyGlutWin(int* argc, char **argv, int winX, int winY) ; MyGlutWin(int* argc, char **argv, int winX, int winY) ;
...@@ -314,11 +314,11 @@ void MyGlutWin::init() ...@@ -314,11 +314,11 @@ void MyGlutWin::init()
normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ; normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ;
laplacian = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "laplacian") ; laplacian = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "laplacian") ;
vbo_render = new Algo::Render::VBO::MapRender_VBO() ; vbo_render = new Algo::Render::GL2::MapRender_VBO() ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ; updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ; updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
topo_render = new Algo::Render::VBO::topo_VBORenderMapD() ; topo_render = new Algo::Render::GL2::topo_VBORenderMapD() ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ; topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
} }
...@@ -365,7 +365,7 @@ void MyGlutWin::myRedraw() ...@@ -365,7 +365,7 @@ void MyGlutWin::myRedraw()
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
glLineWidth(1.0f) ; glLineWidth(1.0f) ;
glColor3f(0.0f,0.0f,0.0f); glColor3f(0.0f,0.0f,0.0f);
vbo_render->draw(Algo::Render::VBO::LINES) ; vbo_render->draw(Algo::Render::GL2::LINES) ;
} }
if(renderPoints) if(renderPoints)
...@@ -373,7 +373,7 @@ void MyGlutWin::myRedraw() ...@@ -373,7 +373,7 @@ void MyGlutWin::myRedraw()
glPointSize(2.0f) ; glPointSize(2.0f) ;
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
glColor3f(0.3f,0.3f,0.8f); glColor3f(0.3f,0.3f,0.8f);
vbo_render->draw(Algo::Render::VBO::POINTS) ; vbo_render->draw(Algo::Render::GL2::POINTS) ;
} }
if(renderNormals) if(renderNormals)
...@@ -408,7 +408,7 @@ void MyGlutWin::myRedraw() ...@@ -408,7 +408,7 @@ void MyGlutWin::myRedraw()
glShadeModel(GL_FLAT) ; glShadeModel(GL_FLAT) ;
shaders[1].bind() ; shaders[1].bind() ;
glUniform1fARB(glGetUniformLocationARB(shaders[1].program_handler(),"explode"), faceShrinkage) ; glUniform1fARB(glGetUniformLocationARB(shaders[1].program_handler(),"explode"), faceShrinkage) ;
vbo_render->draw(Algo::Render::VBO::TRIANGLES) ; vbo_render->draw(Algo::Render::GL2::TRIANGLES) ;
shaders[1].unbind() ; shaders[1].unbind() ;
} }
else else
...@@ -416,7 +416,7 @@ void MyGlutWin::myRedraw() ...@@ -416,7 +416,7 @@ void MyGlutWin::myRedraw()
glShadeModel(GL_SMOOTH) ; glShadeModel(GL_SMOOTH) ;
if(renderStyle == PHONG) if(renderStyle == PHONG)
shaders[0].bind() ; shaders[0].bind() ;
vbo_render->draw(Algo::Render::VBO::TRIANGLES) ; vbo_render->draw(Algo::Render::GL2::TRIANGLES) ;
if(renderStyle == PHONG) if(renderStyle == PHONG)
shaders[0].unbind() ; shaders[0].unbind() ;
} }
...@@ -443,8 +443,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -443,8 +443,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ; t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ; updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ; updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ; topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ; t2 = glutGet(GLUT_ELAPSED_TIME) ;
...@@ -467,8 +467,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -467,8 +467,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ; t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ; updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ; updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ; topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ; t2 = glutGet(GLUT_ELAPSED_TIME) ;
...@@ -498,8 +498,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -498,8 +498,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ; t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ; updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ; updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ; topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ; t2 = glutGet(GLUT_ELAPSED_TIME) ;
...@@ -522,8 +522,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -522,8 +522,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ; t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ; updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ; updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ; topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ; t2 = glutGet(GLUT_ELAPSED_TIME) ;
...@@ -546,8 +546,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -546,8 +546,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ; t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ; updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ; updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ; topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ; t2 = glutGet(GLUT_ELAPSED_TIME) ;
...@@ -572,8 +572,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -572,8 +572,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ; t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ; updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ; updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ; topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ; t2 = glutGet(GLUT_ELAPSED_TIME) ;
...@@ -610,8 +610,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -610,8 +610,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ; t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ; updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ; updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ; topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ; t2 = glutGet(GLUT_ELAPSED_TIME) ;
...@@ -635,8 +635,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -635,8 +635,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ; t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ; updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ; updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ; topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ; t2 = glutGet(GLUT_ELAPSED_TIME) ;
...@@ -698,8 +698,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -698,8 +698,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
// } // }
// } // }
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ; updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ; updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ; topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
glutPostRedisplay() ; glutPostRedisplay() ;
...@@ -722,32 +722,32 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -722,32 +722,32 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
void MyGlutWin::updateVBOprimitives(int upType) void MyGlutWin::updateVBOprimitives(int upType)
{ {
if(upType & Algo::Render::VBO::TRIANGLES) if(upType & Algo::Render::GL2::TRIANGLES)
{ {
vbo_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::TRIANGLES) ; vbo_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES) ;
} }
if(upType & Algo::Render::VBO::LINES) if(upType & Algo::Render::GL2::LINES)
{ {
vbo_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES) ; vbo_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES) ;
} }
if(upType & Algo::Render::VBO::POINTS) if(upType & Algo::Render::GL2::POINTS)
{ {
vbo_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::POINTS) ; vbo_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::POINTS) ;
} }
} }
void MyGlutWin::updateVBOdata(int upType, bool recompute) void MyGlutWin::updateVBOdata(int upType, bool recompute)
{ {
if(upType & Algo::Render::VBO::POSITIONS) if(upType & Algo::Render::GL2::POSITIONS)
vbo_render->updateData(Algo::Render::VBO::POSITIONS, position) ; vbo_render->updateData(Algo::Render::GL2::POSITIONS, position) ;
if(upType & Algo::Render::VBO::NORMALS) if(upType & Algo::Render::GL2::NORMALS)
{ {
if(recompute) if(recompute)
Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ; Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
vbo_render->updateData(Algo::Render::VBO::NORMALS, normal) ; vbo_render->updateData(Algo::Render::GL2::NORMALS, normal) ;
if(renderNormals) if(renderNormals)
initDL(MyGlutWin::NORMALS) ; initDL(MyGlutWin::NORMALS) ;
} }
......
...@@ -93,7 +93,7 @@ public: ...@@ -93,7 +93,7 @@ public:
/** /**
* render object * render object
*/ */
Algo::Render::VBO::MapRender_VBO* m_render; Algo::Render::GL2::MapRender_VBO* m_render;
...@@ -132,14 +132,14 @@ void myGlutWin::updateRender() ...@@ -132,14 +132,14 @@ void myGlutWin::updateRender()
// create the renderer (first call only) // create the renderer (first call only)
if (m_render == NULL) if (m_render == NULL)
m_render = new Algo::Render::VBO::MapRender_VBO() ; m_render = new Algo::Render::GL2::MapRender_VBO() ;
// update buffer op vertices positions // update buffer op vertices positions
m_render->updateData(Algo::Render::VBO::POSITIONS, position); m_render->updateData(Algo::Render::GL2::POSITIONS, position);
// update flat faces primtives (warning need position buffer) // update flat faces primtives (warning need position buffer)
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::FLAT_TRIANGLES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::FLAT_TRIANGLES);
// update lines primitives // update lines primitives
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
} }
...@@ -157,7 +157,7 @@ void myGlutWin::myRedraw(void) ...@@ -157,7 +157,7 @@ void myGlutWin::myRedraw(void)
// DRAW LINES OF OBJECTS // DRAW LINES OF OBJECTS
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
glColor3f(1.0f,1.0f,0.0f); glColor3f(1.0f,1.0f,0.0f);
m_render->draw(Algo::Render::VBO::LINES) ; m_render->draw(Algo::Render::GL2::LINES) ;