Commit f2cbc9f2 authored by Sylvain Thery's avatar Sylvain Thery

MAJ bug Mac OSX Lion

parent bbbb8e0f
......@@ -57,7 +57,11 @@
#include <zlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <malloc.h>
#ifdef __APPLE__
#include <sys/malloc.h>
#else
#include <malloc.h>
#endif
#include <string.h>
#ifndef WIN32
#include <strings.h>
......
......@@ -22,7 +22,7 @@
* *
*******************************************************************************/
#include <GL/gl.h>
#include <GL/glew.h>
#include "Geometry/transfo.h"
namespace CGoGN
......
......@@ -26,7 +26,6 @@
#define __RENDER_FUNCTOR_GL_H
#include <vector>
#include <IL/ilut.h>
namespace CGoGN
{
......
......@@ -28,7 +28,7 @@
#include <list>
//#include <gmtl/VecOps.h>
//#include <gmtl/Output.h>
#include <GL/gl.h>
#include <GL/glew.h>
#include "Topology/generic/functor.h"
......
......@@ -25,7 +25,7 @@
#ifndef _EXPLODE_VOLUME_VBO_RENDER
#define _EXPLODE_VOLUME_VBO_RENDER
#include <GL/gl.h>
#include <GL/glew.h>
#include <vector>
#include <list>
......
......@@ -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; }
......
......@@ -26,8 +26,7 @@
#define CGOGN_TEXTURES_H_
#include "Geometry/vector_gen.h"
#include <GL/gl.h>
#include <GL/glew.h>
#include <string>
#include <QImage>
......
......@@ -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;
......
......@@ -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();
......
......@@ -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();
......
......@@ -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");
......
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