Commit 26dd6409 authored by Thery Sylvain's avatar Thery Sylvain

Merge branch 'develop' of icube-forge.unistra.fr:thery/cgogn into develop

parents f48cfbc9 df283e4f
...@@ -78,7 +78,9 @@ void Viewer::initGUI() ...@@ -78,7 +78,9 @@ void Viewer::initGUI()
void Viewer::cb_initGL() void Viewer::cb_initGL()
{ {
Utils::GLSLShader::setCurrentOGLVersion(2) ; Utils::GLSLShader::setCurrentOGLVersion(3) ;
CGoGNout << "GL VERSION = "<< glGetString(GL_VERSION)<< CGoGNendl;
Utils::GLSLShader::areShadersSupported();
m_render = new Algo::Render::GL2::MapRender() ; m_render = new Algo::Render::GL2::MapRender() ;
m_topoRender = new Algo::Render::GL2::TopoRenderMap<PFP>() ; m_topoRender = new Algo::Render::GL2::TopoRenderMap<PFP>() ;
......
...@@ -206,6 +206,8 @@ void MyQT::cb_initGL() ...@@ -206,6 +206,8 @@ void MyQT::cb_initGL()
{ {
// choose to use GL version 2 // choose to use GL version 2
Utils::GLSLShader::setCurrentOGLVersion(2); Utils::GLSLShader::setCurrentOGLVersion(2);
CGoGNout << "GL VERSION = "<< glGetString(GL_VERSION)<< CGoGNendl;
Utils::GLSLShader::areShadersSupported();
// create the renders // create the renders
m_topo_render = new Algo::Render::GL2::Topo3RenderMap<PFP>(); m_topo_render = new Algo::Render::GL2::Topo3RenderMap<PFP>();
......
...@@ -106,7 +106,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed) ...@@ -106,7 +106,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
DartMarker<MAP> cmf(map); DartMarker<MAP> cmf(map);
cmf.markOrbit<FACE>(faceSeed); cmf.template markOrbit<FACE>(faceSeed);
propag.push_back(faceSeed); propag.push_back(faceSeed);
while (!propag.empty() || !propag_inv.empty()) while (!propag.empty() || !propag_inv.empty())
...@@ -120,7 +120,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed) ...@@ -120,7 +120,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
do do
{ {
Dart e = map.phi2(d); Dart e = map.phi2(d);
if (map.isBoundaryMarked2(e)) if (map.template isBoundaryMarked<2>(e))
{ {
e = findOtherInCouplesOfDarts(couples,d); e = findOtherInCouplesOfDarts(couples,d);
if (e!=NIL) if (e!=NIL)
...@@ -129,7 +129,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed) ...@@ -129,7 +129,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
{ {
propag_inv.push_back(e); propag_inv.push_back(e);
face2invert.push_back(e); face2invert.push_back(e);
cmf.markOrbit<FACE>(e); cmf.template markOrbit<FACE>(e);
} }
cmf.mark(map.phi2(e));// use cmf also to mark boudary cycle to invert cmf.mark(map.phi2(e));// use cmf also to mark boudary cycle to invert
} }
...@@ -140,7 +140,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed) ...@@ -140,7 +140,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
if (!cmf.isMarked(e)) if (!cmf.isMarked(e))
{ {
propag.push_back(e); propag.push_back(e);
cmf.markOrbit<FACE>(e); cmf.template markOrbit<FACE>(e);
} }
} }
d= map.phi1(d); d= map.phi1(d);
...@@ -157,7 +157,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed) ...@@ -157,7 +157,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
do do
{ {
Dart e = map.phi2(d); Dart e = map.phi2(d);
if (map.isBoundaryMarked2(e)) if (map.template isBoundaryMarked<2>(e))
{ {
e = findOtherInCouplesOfDarts(couples,d); e = findOtherInCouplesOfDarts(couples,d);
if (e!=NIL) if (e!=NIL)
...@@ -165,7 +165,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed) ...@@ -165,7 +165,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
if (!cmf.isMarked(e)) if (!cmf.isMarked(e))
{ {
propag.push_back(e); propag.push_back(e);
cmf.markOrbit<FACE>(e); cmf.template markOrbit<FACE>(e);
} }
cmf.mark(map.phi2(d));// use cmf also to mark boudary cycle to invert cmf.mark(map.phi2(d));// use cmf also to mark boudary cycle to invert
} }
...@@ -176,7 +176,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed) ...@@ -176,7 +176,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
{ {
propag_inv.push_back(e); propag_inv.push_back(e);
face2invert.push_back(e); face2invert.push_back(e);
cmf.markOrbit<FACE>(e); cmf.template markOrbit<FACE>(e);
} }
} }
d= map.phi1(d); // traverse all edges of face d= map.phi1(d); // traverse all edges of face
...@@ -195,7 +195,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed) ...@@ -195,7 +195,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
if (cmf.isMarked(e)) // check cmf for wrong orientation if (cmf.isMarked(e)) // check cmf for wrong orientation
{ {
reverse2MapFaceKeepPhi2<MAP>(map,e); reverse2MapFaceKeepPhi2<MAP>(map,e);
cmf.unmarkOrbit<FACE>(e); cmf.template unmarkOrbit<FACE>(e);
} }
} }
......
...@@ -148,10 +148,35 @@ bool GLSLShader::areGeometryShadersSupported() ...@@ -148,10 +148,35 @@ bool GLSLShader::areGeometryShadersSupported()
bool GLSLShader::areShadersSupported() bool GLSLShader::areShadersSupported()
{ {
if ( ! glewGetExtension("GL_ARB_vertex_shader")) return false; if ( ! glewIsSupported("GL_ARB_vertex_shader"))
if ( ! glewGetExtension("GL_ARB_fragment_shader")) return false; {
if ( ! glewGetExtension("GL_ARB_shader_objects")) return false; CGoGNerr << " vertex shaders not supported!" <<CGoGNendl;
if ( ! glewGetExtension("GL_ARB_shading_language_100")) return false; return false;
}
if ( ! glewIsSupported("GL_ARB_fragment_shader"))
{
CGoGNerr << " fragment shaders not supported!" << CGoGNendl;
return false;
}
if ( ! glewIsSupported("GL_ARB_geometry_shader4"))
{
CGoGNerr << " geometry shaders not supported!" << CGoGNendl;
return false;
}
if ( ! glewIsSupported("GL_ARB_shader_objects"))
{
CGoGNerr << " shaders not supported!" << CGoGNendl;
return false;
}
if ( ! glewIsSupported("GL_ARB_shading_language_100"))
{
CGoGNerr << " GLSL no supported!" << CGoGNendl;
return false;
}
return true; return true;
} }
...@@ -399,7 +424,7 @@ bool GLSLShader::loadGeometryShaderSourceString( const char *geom_shader_source ...@@ -399,7 +424,7 @@ bool GLSLShader::loadGeometryShaderSourceString( const char *geom_shader_source
*m_geom_shader_object=0; *m_geom_shader_object=0;
} }
/*** create shader object ***/ /*** create shader object ***/
*m_geom_shader_object = glCreateShader(GL_GEOMETRY_SHADER_EXT); *m_geom_shader_object = glCreateShader(GL_GEOMETRY_SHADER);
if( !*m_geom_shader_object ) if( !*m_geom_shader_object )
{ {
......
...@@ -193,7 +193,6 @@ glm::vec3& GLWidget::getObjPos() ...@@ -193,7 +193,6 @@ glm::vec3& GLWidget::getObjPos()
void GLWidget::initializeGL() void GLWidget::initializeGL()
{ {
std::cout << "GL VERSION = "<< glGetString(GL_VERSION)<< std::endl;
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
if (m_cbs) if (m_cbs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment