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)
target_link_libraries( Geom_inclusionD
${COMMON_LIBS} )
add_executable( Algo_Geom_inclusionD ./Algo_Geom_inclusion.cpp)
target_link_libraries( Algo_Geom_inclusionD
containerD topologyD utilsD algoD ${COMMON_LIBS} )
#add_executable( Algo_Geom_inclusionD ./Algo_Geom_inclusion.cpp)
#target_link_libraries( Algo_Geom_inclusionD
# containerD topologyD utilsD algoD ${COMMON_LIBS} )
......@@ -137,7 +137,7 @@ public:
*/
int renderStyle;
Algo::Render::VBO::MapRender_VBO* m_render;
Algo::Render::GL2::MapRender_VBO* m_render;
/**
* render mode enum
......@@ -152,14 +152,14 @@ public:
{
if (this->shaderOk) shaders[0].loadShaders("phong_vs.txt","phong_ps.txt");
// m_cb = new Algo::Render::VBO::VBO_CB_PositionNormal<PFP>(myMap);
// m_render = new Algo::Render::VBO::MapRender_VBO(myMap, allDarts, m_cb);
// m_cb = new Algo::Render::GL2::GL2_CB_PositionNormal<PFP>(myMap);
// m_render = new Algo::Render::GL2::MapRender_VBO(myMap, allDarts, m_cb);
//
// m_render->initBuffers();
// m_render->updateData(Algo::Render::VBO::POSITIONS, position );
// m_render->updateData(Algo::Render::VBO::NORMALS, normal );
// m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::TRIANGLES);
// m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::LINES);
// m_render->updateData(Algo::Render::GL2::POSITIONS, position );
// m_render->updateData(Algo::Render::GL2::NORMALS, normal );
// m_render->initPrimitives<PFP>(myMap, good, Algo::Render::GL2::TRIANGLES);
// m_render->initPrimitives<PFP>(myMap, good, Algo::Render::GL2::LINES);
}
};
......@@ -186,12 +186,12 @@ void myGlutWin::myRedraw(void)
Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
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);
glDisable(GL_LIGHTING);
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);
Algo::Render::Direct::renderTriQuadPoly<PFP>(myMap, Algo::Render::Direct::LINE, 1.0, position, normal);
// glPointSize(5.0f);
......@@ -227,7 +227,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
position[it] += normal[it] * 0.1;
}
m_render->updateData(Algo::Render::VBO::POSITIONS, position );
m_render->updateData(Algo::Render::GL2::POSITIONS, position );
}
break;
......@@ -239,7 +239,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
normal[it] *= -1.0f;
}
m_render->updateData(Algo::Render::VBO::NORMALS, normal );
m_render->updateData(Algo::Render::GL2::NORMALS, normal );
}
break;
......
......@@ -147,47 +147,47 @@ void MyGlutWin::myRedraw(void)
if(render_obj)
{
m_render->updateData(Algo::Render::VBO::POSITIONS, position );
//m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::POINTS);
m_render->updateData(Algo::Render::GL2::POSITIONS, position );
//m_render->initPrimitives<PFP>(myMap, good, Algo::Render::GL2::POINTS);
if(renderObjStyle == O_ALL)
{
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::TRIANGLES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
glEnable( GL_POLYGON_OFFSET_FILL );
glPolygonOffset( 1.0f, 1.0f );
glColor3f(0.0f,0.5f,0.0f);
//shaders[3].bind();
m_render->draw(Algo::Render::VBO::TRIANGLES);
m_render->draw(Algo::Render::GL2::TRIANGLES);
//shaders[3].unbind();
glDisable( GL_POLYGON_OFFSET_FILL );
// on trace les ligne devant
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)
{
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 );
glPolygonOffset( 1.0f, 1.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 );
}
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
glDisable( GL_POLYGON_OFFSET_FILL );
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)
{
......@@ -271,14 +271,14 @@ void MyGlutWin::initRender()
{
// maj des donnees de position
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);
GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "updateData: "<< seconds << "sec" << std::endl;
// creation des primitives de rendu a partir de la carte
t1 = glutGet(GLUT_ELAPSED_TIME);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::TRIANGLES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f;
std::cout << "initPrimitives: "<< seconds << "sec" << std::endl;
......@@ -414,9 +414,9 @@ int main(int argc, char **argv)
// allocation des objets necessaires pour le rendu
mgw->m_render = new Algo::Render::VBO::MapRender_VBO();
//mgw->m_render_topo = new Algo::Render::VBO::topo3_VBORenderMap<PFP::MAP>();
mgw->m_render_topo = new Algo::Render::VBO::topo3_VBORenderMapD();
mgw->m_render = new Algo::Render::GL2::MapRender_VBO();
//mgw->m_render_topo = new Algo::Render::GL2::topo3_VBORenderMap<PFP::MAP>();
mgw->m_render_topo = new Algo::Render::GL2::topo3_VBORenderMapD();
mgw->init();
mgw->initRender();
......
......@@ -132,13 +132,13 @@ public:
/*
* VBO Object rendering
*/
Algo::Render::VBO::MapRender_VBO* m_render;
Algo::Render::GL2::MapRender_VBO* m_render;
/*
* VBO Topo rendering
*/
//Algo::Render::VBO::topo_MD3_VBORender<PFP>* m_render_topo;
Algo::Render::VBO::topo3_VBORenderMapD* m_render_topo;
//Algo::Render::GL2::topo_MD3_VBORender<PFP>* m_render_topo;
Algo::Render::GL2::topo3_VBORenderMapD* m_render_topo;
/*
* ALGO VARIABLES
......
......@@ -95,7 +95,7 @@ public:
/**
* render object
*/
Algo::Render::VBO::MapRender_VBO* m_render;
Algo::Render::GL2::MapRender_VBO* m_render;
......@@ -134,14 +134,14 @@ void myGlutWin::updateRender()
// create the renderer (first call only)
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
m_render->updateData(Algo::Render::VBO::POSITIONS, position);
m_render->updateData(Algo::Render::GL2::POSITIONS, position);
// 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
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)
// DRAW LINES OF OBJECTS
glDisable(GL_LIGHTING);
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
glEnable( GL_POLYGON_OFFSET_FILL );
......@@ -170,7 +170,7 @@ void myGlutWin::myRedraw(void)
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE);
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 );
......
......@@ -93,8 +93,8 @@ public:
PFP::TVEC3 normal ;
PFP::TVEC3 laplacian ;
Algo::Render::VBO::MapRender_VBO* vbo_render ;
Algo::Render::VBO::topo_VBORenderMapD* topo_render ;
Algo::Render::GL2::MapRender_VBO* vbo_render ;
Algo::Render::GL2::topo_VBORenderMapD* topo_render ;
GLuint dl_norm, dl_lapl ;
MyGlutWin(int* argc, char **argv, int winX, int winY) ;
......@@ -314,11 +314,11 @@ void MyGlutWin::init()
normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ;
laplacian = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "laplacian") ;
vbo_render = new Algo::Render::VBO::MapRender_VBO() ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
vbo_render = new Algo::Render::GL2::MapRender_VBO() ;
updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
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) ;
}
......@@ -365,7 +365,7 @@ void MyGlutWin::myRedraw()
glDisable(GL_LIGHTING);
glLineWidth(1.0f) ;
glColor3f(0.0f,0.0f,0.0f);
vbo_render->draw(Algo::Render::VBO::LINES) ;
vbo_render->draw(Algo::Render::GL2::LINES) ;
}
if(renderPoints)
......@@ -373,7 +373,7 @@ void MyGlutWin::myRedraw()
glPointSize(2.0f) ;
glDisable(GL_LIGHTING);
glColor3f(0.3f,0.3f,0.8f);
vbo_render->draw(Algo::Render::VBO::POINTS) ;
vbo_render->draw(Algo::Render::GL2::POINTS) ;
}
if(renderNormals)
......@@ -408,7 +408,7 @@ void MyGlutWin::myRedraw()
glShadeModel(GL_FLAT) ;
shaders[1].bind() ;
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() ;
}
else
......@@ -416,7 +416,7 @@ void MyGlutWin::myRedraw()
glShadeModel(GL_SMOOTH) ;
if(renderStyle == PHONG)
shaders[0].bind() ;
vbo_render->draw(Algo::Render::VBO::TRIANGLES) ;
vbo_render->draw(Algo::Render::GL2::TRIANGLES) ;
if(renderStyle == PHONG)
shaders[0].unbind() ;
}
......@@ -443,8 +443,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
......@@ -467,8 +467,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
......@@ -498,8 +498,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
......@@ -522,8 +522,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
......@@ -546,8 +546,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
......@@ -572,8 +572,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
......@@ -610,8 +610,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
......@@ -635,8 +635,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
......@@ -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) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
updateVBOdata(Algo::Render::GL2::POSITIONS | Algo::Render::GL2::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
glutPostRedisplay() ;
......@@ -722,32 +722,32 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
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)
{
if(upType & Algo::Render::VBO::POSITIONS)
vbo_render->updateData(Algo::Render::VBO::POSITIONS, position) ;
if(upType & Algo::Render::GL2::POSITIONS)
vbo_render->updateData(Algo::Render::GL2::POSITIONS, position) ;
if(upType & Algo::Render::VBO::NORMALS)
if(upType & Algo::Render::GL2::NORMALS)
{
if(recompute)
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)
initDL(MyGlutWin::NORMALS) ;
}
......
......@@ -93,7 +93,7 @@ public:
/**
* render object
*/
Algo::Render::VBO::MapRender_VBO* m_render;
Algo::Render::GL2::MapRender_VBO* m_render;
......@@ -132,14 +132,14 @@ void myGlutWin::updateRender()
// create the renderer (first call only)
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
m_render->updateData(Algo::Render::VBO::POSITIONS, position);
m_render->updateData(Algo::Render::GL2::POSITIONS, position);
// 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
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)
// DRAW LINES OF OBJECTS
glDisable(GL_LIGHTING);
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
glEnable( GL_POLYGON_OFFSET_FILL );
......@@ -168,7 +168,7 @@ void myGlutWin::myRedraw(void)
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE);
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 );
......
......@@ -100,7 +100,7 @@ public:
/**
* render object
*/
Algo::Render::VBO::MapRender_VBO* m_render;
Algo::Render::GL2::MapRender_VBO* m_render;
......@@ -145,19 +145,19 @@ void myGlutWin::updateRender()
// create the renderer (first call only)
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
m_render->updateData(Algo::Render::VBO::POSITIONS, position);
m_render->updateData(Algo::Render::GL2::POSITIONS, position);
// 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 smooth faces primtives
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::TRIANGLES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
// update lines primitives
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
m_render->updateData(Algo::Render::VBO::NORMALS, normal);
m_render->updateData(Algo::Render::GL2::NORMALS, normal);
}
......@@ -175,7 +175,7 @@ void myGlutWin::myRedraw(void)
// // DRAW LINES OF OBJECTS
// glDisable(GL_LIGHTING);
// 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
// glEnable( GL_POLYGON_OFFSET_FILL );
......@@ -186,7 +186,7 @@ void myGlutWin::myRedraw(void)
// glEnable(GL_COLOR_MATERIAL);
// glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE);
// glColor3f(0.0f,0.0f,0.9f);
// m_render->draw(Algo::Render::VBO::TRIANGLES) ;
// m_render->draw(Algo::Render::GL2::TRIANGLES) ;
//
// glDisable( GL_POLYGON_OFFSET_FILL );
......@@ -252,28 +252,28 @@ int main(int argc, char **argv)
Algo::Geometry::computeNormalVertices<PFP>(myMap, mgw.position, mgw.normal) ;
Algo::Render::VBO::MapRender_VBO* render1 = new Algo::Render::VBO::MapRender_VBO() ;
render1->updateData(Algo::Render::VBO::POSITIONS, mgw.position);
render1->updateData(Algo::Render::VBO::NORMALS, mgw.normal);
Algo::Render::GL2::MapRender_VBO* render1 = new Algo::Render::GL2::MapRender_VBO() ;
render1->updateData(Algo::Render::GL2::POSITIONS, mgw.position);
render1->updateData(Algo::Render::GL2::NORMALS, mgw.normal);
SelectorCellMarked cm1(mark1);
render1->initPrimitives<PFP>(myMap, cm1, Algo::Render::VBO::TRIANGLES);
render1->initPrimitives<PFP>(myMap, cm1, Algo::Render::VBO::FLAT_TRIANGLES);
render1->initPrimitives<PFP>(myMap, cm1, Algo::Render::VBO::LINES);
render1->initPrimitives<PFP>(myMap, cm1, Algo::Render::GL2::TRIANGLES);
render1->initPrimitives<PFP>(myMap, cm1, Algo::Render::GL2::FLAT_TRIANGLES);
render1->initPrimitives<PFP>(myMap, cm1, Algo::Render::GL2::LINES);
Algo::Render::VBO::MapRender_VBO* render2 = new Algo::Render::VBO::MapRender_VBO(*render1) ;
Algo::Render::GL2::MapRender_VBO* render2 = new Algo::Render::GL2::MapRender_VBO(*render1) ;
SelectorCellMarked cm2(mark2);
render2->initPrimitives<PFP>(myMap, cm2, Algo::Render::VBO::TRIANGLES);
render2->initPrimitives<PFP>(myMap, cm2, Algo::Render::VBO::FLAT_TRIANGLES);
render2->initPrimitives<PFP>(myMap, cm2, Algo::Render::VBO::POINTS);
render2->initPrimitives<PFP>(myMap, cm2, Algo::Render::GL2::TRIANGLES);
render2->initPrimitives<PFP>(myMap, cm2, Algo::Render::GL2::FLAT_TRIANGLES);
render2->initPrimitives<PFP>(myMap, cm2, Algo::Render::GL2::POINTS);
Algo::Render::VBO::MapRender_VBO* render3 = new Algo::Render::VBO::MapRender_VBO(*render1) ;
Algo::Render::GL2::MapRender_VBO* render3 = new Algo::Render::GL2::MapRender_VBO(*render1) ;
SelectorCellMarked cm3(mark3);
render3->initPrimitives<PFP>(myMap, cm3, Algo::Render::VBO::FLAT_TRIANGLES);
render3->initPrimitives<PFP>(myMap, cm3, Algo::Render::VBO::TRIANGLES);
render3->initPrimitives<PFP>(myMap, cm3, Algo::Render::VBO::LINES);
render3->initPrimitives<PFP>(myMap, cm3, Algo::Render::GL2::FLAT_TRIANGLES);
render3->initPrimitives<PFP>(myMap, cm3, Algo::Render::GL2::TRIANGLES);
render3->initPrimitives<PFP>(myMap, cm3, Algo::Render::GL2::LINES);
mgw.root = new Utils::SceneGraph::Group_Node();
......@@ -288,9 +288,9 @@ int main(int argc, char **argv)
mgw.root->setMaterial(mater);
Utils::SceneGraph::VBO_Node* vbon = new Utils::SceneGraph::VBO_Node(render1);
vbon->setPrimitives(Algo::Render::VBO::FLAT_TRIANGLES);
vbon->setPrimitives(Algo::Render::VBO::LINES);
Utils::SceneGraph::GL2_Node* vbon = new Utils::SceneGraph::GL2_Node(render1);
vbon->setPrimitives(Algo::Render::GL2::FLAT_TRIANGLES);
vbon->setPrimitives(Algo::Render::GL2::LINES);
mgw.root->addChild(vbon);
......@@ -302,9 +302,9 @@ int main(int argc, char **argv)
mgw.root->addChild(group1);
Utils::SceneGraph::VBO_Node* vbon2 = new Utils::SceneGraph::VBO_Node(render2);
vbon2->setPrimitives(Algo::Render::VBO::TRIANGLES);
vbon2->setPrimitives(Algo::Render::VBO::POINTS);
Utils::SceneGraph::GL2_Node* vbon2 = new Utils::SceneGraph::GL2_Node(render2);
vbon2->setPrimitives(Algo::Render::GL2::TRIANGLES);
vbon2->setPrimitives(Algo::Render::GL2::POINTS);
group1->addChild(vbon2);
......@@ -325,9 +325,9 @@ int main(int argc, char **argv)
mater->setNoShader();
group2->setMaterial(mater);
vbon = new Utils::SceneGraph::VBO_Node(render3);
vbon->setPrimitives(Algo::Render::VBO::TRIANGLES);
vbon->setPrimitives(Algo::Render::VBO::LINES);
vbon = new Utils::SceneGraph::GL2_Node(render3);
vbon->setPrimitives(Algo::Render::GL2::TRIANGLES);
vbon->setPrimitives(Algo::Render::GL2::LINES);
group2->addChild(vbon);
......
......@@ -166,7 +166,7 @@ public:
/**
* render topology
*/
Algo::Render::VBO::topo_VBORenderGMap* m_render_topo;
Algo::Render::GL2::topo_VBORenderGMap* m_render_topo;
/**
* render mode enum
......@@ -186,7 +186,7 @@ public:
dl_norm(-1)
{
if (this->shaderOk) shaders[0].loadShaders("phong_vs.txt","phong_ps.txt");