From f2cbc9f2b2a159f286cbb961516500b237fe713d Mon Sep 17 00:00:00 2001 From: Sylvain Thery Date: Wed, 7 Dec 2011 14:29:49 +0100 Subject: [PATCH] MAJ bug Mac OSX Lion --- ThirdParty/Zinri/ImageIO.h | 6 +++++- include/Algo/Modelisation/extrusion.hpp | 2 +- include/Algo/Render/GL1/renderFunctor.h | 1 - include/Algo/Render/GL1/topo_render.h | 2 +- include/Algo/Render/GL2/explodeVolumeRender.h | 2 +- include/Utils/GLSLShader.h | 6 +++--- include/Utils/textures.h | 3 +-- src/Utils/GLSLShader.cpp | 14 ++++++-------- src/Utils/Shaders/shaderFlat.cpp | 2 +- src/Utils/Shaders/shaderVectorPerVertex.cpp | 2 +- src/Utils/pointSprite.cpp | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ThirdParty/Zinri/ImageIO.h b/ThirdParty/Zinri/ImageIO.h index d4d0d0b3..935e4d1f 100644 --- a/ThirdParty/Zinri/ImageIO.h +++ b/ThirdParty/Zinri/ImageIO.h @@ -57,7 +57,11 @@ #include #include #include -#include +#ifdef __APPLE__ + #include +#else + #include +#endif #include #ifndef WIN32 #include diff --git a/include/Algo/Modelisation/extrusion.hpp b/include/Algo/Modelisation/extrusion.hpp index b1c91a3a..57169bee 100644 --- a/include/Algo/Modelisation/extrusion.hpp +++ b/include/Algo/Modelisation/extrusion.hpp @@ -22,7 +22,7 @@ * * *******************************************************************************/ -#include +#include #include "Geometry/transfo.h" namespace CGoGN diff --git a/include/Algo/Render/GL1/renderFunctor.h b/include/Algo/Render/GL1/renderFunctor.h index cb39b940..ef69ce6a 100644 --- a/include/Algo/Render/GL1/renderFunctor.h +++ b/include/Algo/Render/GL1/renderFunctor.h @@ -26,7 +26,6 @@ #define __RENDER_FUNCTOR_GL_H #include -#include namespace CGoGN { diff --git a/include/Algo/Render/GL1/topo_render.h b/include/Algo/Render/GL1/topo_render.h index 562667e1..0a938d07 100644 --- a/include/Algo/Render/GL1/topo_render.h +++ b/include/Algo/Render/GL1/topo_render.h @@ -28,7 +28,7 @@ #include //#include //#include -#include +#include #include "Topology/generic/functor.h" diff --git a/include/Algo/Render/GL2/explodeVolumeRender.h b/include/Algo/Render/GL2/explodeVolumeRender.h index e9a94c3d..50a78752 100644 --- a/include/Algo/Render/GL2/explodeVolumeRender.h +++ b/include/Algo/Render/GL2/explodeVolumeRender.h @@ -25,7 +25,7 @@ #ifndef _EXPLODE_VOLUME_VBO_RENDER #define _EXPLODE_VOLUME_VBO_RENDER -#include +#include #include #include diff --git a/include/Utils/GLSLShader.h b/include/Utils/GLSLShader.h index 2e025352..31b988c0 100644 --- a/include/Utils/GLSLShader.h +++ b/include/Utils/GLSLShader.h @@ -165,7 +165,7 @@ protected: /** * create the shader (attach and link shaders into program) */ - bool create(GLint inputGeometryPrimitive=GL_TRIANGLES,GLint outputGeometryPrimitive=GL_TRIANGLES); + bool create(GLint inputGeometryPrimitive=GL_TRIANGLES,GLint outputGeometryPrimitive=GL_TRIANGLES, int nb_max_vertices=16); /** * get log after compiling @@ -235,7 +235,7 @@ public: * @param inputGeometryPrimitive primitives used in geometry shader as input * @param outputGeometryPrimitive primitives generated in geometry shader as output */ - bool loadShaders(const std::string& vs, const std::string& fs, const std::string& gs, GLint inputGeometryPrimitive=GL_TRIANGLES,GLint outputGeometryPrimitive=GL_TRIANGLE_STRIP); + bool loadShaders(const std::string& vs, const std::string& fs, const std::string& gs, GLint inputGeometryPrimitive=GL_TRIANGLES,GLint outputGeometryPrimitive=GL_TRIANGLE_STRIP, int nb_max_vertices=16); /** * load shaders (compile and link) @@ -254,7 +254,7 @@ public: * @param inputGeometryPrimitive primitives used in geometry shader as input * @param outputGeometryPrimitive primitives generated in geometry shader as output */ - bool loadShadersFromMemory(const char* vs, const char* fs, const char* gs, GLint inputGeometryPrimitive,GLint outputGeometryPrimitive); + bool loadShadersFromMemory(const char* vs, const char* fs, const char* gs, GLint inputGeometryPrimitive,GLint outputGeometryPrimitive, int nb_max_vertices=16); const char* getVertexShaderSrc() { return m_vertex_shader_source; } const char* getFragmentShaderSrc() { return m_fragment_shader_source; } diff --git a/include/Utils/textures.h b/include/Utils/textures.h index 1a47b5a3..b8e437b6 100644 --- a/include/Utils/textures.h +++ b/include/Utils/textures.h @@ -26,8 +26,7 @@ #define CGOGN_TEXTURES_H_ #include "Geometry/vector_gen.h" - -#include +#include #include #include diff --git a/src/Utils/GLSLShader.cpp b/src/Utils/GLSLShader.cpp index fcb68a79..d8b195b0 100644 --- a/src/Utils/GLSLShader.cpp +++ b/src/Utils/GLSLShader.cpp @@ -442,7 +442,7 @@ char* GLSLShader::getInfoLog( GLhandleARB obj ) return info_log; } -bool GLSLShader::create(GLint inputGeometryPrimitive,GLint outputGeometryPrimitive) +bool GLSLShader::create(GLint inputGeometryPrimitive,GLint outputGeometryPrimitive, int nb_max_vertices) { int status; char *info_log; @@ -475,9 +475,7 @@ bool GLSLShader::create(GLint inputGeometryPrimitive,GLint outputGeometryPrimiti glProgramParameteriEXT(m_program_object,GL_GEOMETRY_INPUT_TYPE_EXT,inputGeometryPrimitive); glProgramParameteriEXT(m_program_object,GL_GEOMETRY_OUTPUT_TYPE_EXT,outputGeometryPrimitive); - int temp; - glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT,&temp); - glProgramParameteriEXT(m_program_object,GL_GEOMETRY_VERTICES_OUT_EXT,temp); + glProgramParameteriEXT(m_program_object,GL_GEOMETRY_VERTICES_OUT_EXT,nb_max_vertices); } /*** link program object ***/ @@ -669,7 +667,7 @@ bool GLSLShader::loadShaders(const std::string& vs, const std::string& ps) return true; } -bool GLSLShader::loadShaders(const std::string& vs, const std::string& ps, const std::string& gs, GLint inputGeometryPrimitive,GLint outputGeometryPrimitive) +bool GLSLShader::loadShaders(const std::string& vs, const std::string& ps, const std::string& gs, GLint inputGeometryPrimitive,GLint outputGeometryPrimitive, int nb_max_vertices) { m_nameVS = vs; m_nameFS = ps; @@ -689,7 +687,7 @@ bool GLSLShader::loadShaders(const std::string& vs, const std::string& ps, const CGoGNerr << "Error while loading geometry shader" << CGoGNendl; } - if(!create(inputGeometryPrimitive,outputGeometryPrimitive)) + if(!create(inputGeometryPrimitive,outputGeometryPrimitive,nb_max_vertices)) { CGoGNout << "Unable to create the shaders !" << CGoGNendl; return false; @@ -727,7 +725,7 @@ bool GLSLShader::loadShadersFromMemory(const char* vs, const char* fs) return true; } -bool GLSLShader::loadShadersFromMemory(const char* vs, const char* fs, const char* gs, GLint inputGeometryPrimitive,GLint outputGeometryPrimitive) +bool GLSLShader::loadShadersFromMemory(const char* vs, const char* fs, const char* gs, GLint inputGeometryPrimitive,GLint outputGeometryPrimitive, int nb_max_vertices) { if (m_vertex_shader_source) delete [] m_vertex_shader_source; @@ -759,7 +757,7 @@ bool GLSLShader::loadShadersFromMemory(const char* vs, const char* fs, const cha if(!loadGeometryShaderSourceString(gs)) return false; - if(!create(inputGeometryPrimitive,outputGeometryPrimitive)) + if(!create(inputGeometryPrimitive,outputGeometryPrimitive,nb_max_vertices)) { CGoGNout << "Unable to create the shaders !" << CGoGNendl; return false; diff --git a/src/Utils/Shaders/shaderFlat.cpp b/src/Utils/Shaders/shaderFlat.cpp index c5597c92..40942f0c 100644 --- a/src/Utils/Shaders/shaderFlat.cpp +++ b/src/Utils/Shaders/shaderFlat.cpp @@ -99,7 +99,7 @@ ShaderFlat::ShaderFlat() std::string glxfrag(*GLSLShader::DEFINES_GL); glxfrag.append(fragmentShaderText); - loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_TRIANGLES, GL_TRIANGLE_STRIP); + loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_TRIANGLES, GL_TRIANGLE_STRIP,3); getLocations(); diff --git a/src/Utils/Shaders/shaderVectorPerVertex.cpp b/src/Utils/Shaders/shaderVectorPerVertex.cpp index 4c34c3de..2e6189ef 100644 --- a/src/Utils/Shaders/shaderVectorPerVertex.cpp +++ b/src/Utils/Shaders/shaderVectorPerVertex.cpp @@ -88,7 +88,7 @@ ShaderVectorPerVertex::ShaderVectorPerVertex() : std::string glxfrag(*GLSLShader::DEFINES_GL); glxfrag.append(fragmentShaderText); - loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_POINTS, GL_LINE_STRIP); + loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_POINTS, GL_LINE_STRIP,2); // get and fill uniforms bind(); diff --git a/src/Utils/pointSprite.cpp b/src/Utils/pointSprite.cpp index c7501c3b..10af3347 100644 --- a/src/Utils/pointSprite.cpp +++ b/src/Utils/pointSprite.cpp @@ -114,7 +114,7 @@ PointSprite::PointSprite(float radius) std::string glxfrag(*GLSLShader::DEFINES_GL); glxfrag.append(fragmentShaderText); - loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_POINTS, GL_TRIANGLE_STRIP); + loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_POINTS, GL_TRIANGLE_STRIP,4); bind(); m_uniform_size = glGetUniformLocation(program_handler(),"size"); -- GitLab