Commit c32ed9f5 authored by Sylvain Thery's avatar Sylvain Thery

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

Conflicts:
	CGoGN/src/Utils/Shaders/shaderPhong.cpp
	CGoGN/src/Utils/Shaders/shaderSimpleFlat.cpp
parents 35f2eb18 3ae34e1a
......@@ -124,7 +124,6 @@ void MyQT::createMap()
// initialization GL callback
void MyQT::cb_initGL()
{
// create the render
m_render = new Algo::Render::GL2::MapRender();
......
......@@ -53,7 +53,7 @@ ELSE()
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src} )
ENDIF()
add_dependencies(shader_target shader_to_h) #ensure that shader_to_h is compiled
file(
GLOB # WARNING NO MORE RECURSE TO AVOID TAKING QT FILES
......
......@@ -65,26 +65,25 @@ public:
*/
enum shaderType {VERTEX_SHADER = 1, FRAGMENT_SHADER = 2, GEOMETRY_SHADER = 3 };
static unsigned int CURRENT_OGL_VERSION;
static unsigned int MAJOR_OGL_CORE;
static unsigned int MINOR_OGL_CORE;
#ifdef CGOGN_USE_OGL_CORE_PROFILE
static const unsigned int CURRENT_OGL_VERSION = 3;
static const unsigned int MAJOR_OGL_CORE = 3;
static const unsigned int MINOR_OGL_CORE = 3;
#else
static const unsigned int CURRENT_OGL_VERSION = 2;
static const unsigned int MAJOR_OGL_CORE = 2;
static const unsigned int MINOR_OGL_CORE = 1;
#endif
static std::set< std::pair<void*, GLSLShader*> >* m_registeredShaders;
// static glm::mat4* s_current_matrices;
static Utils::GL_Matrices* s_current_matrices;
protected:
static std::string DEFINES_GL2;
static std::string DEFINES_GL3;
static std::string* DEFINES_GL;
static std::string defines_Geom(const std::string& primitivesIn, const std::string& primitivesOut, int maxVert);
static std::string defines_gl();
int m_nbMaxVertices;
GLuint m_vao;
......@@ -210,9 +209,9 @@ public:
*/
virtual ~GLSLShader();
static void setCurrentOGLVersion(unsigned int version);
// static void setCurrentOGLVersion(unsigned int version);
static void setCurrentOGLVersion(unsigned int major,unsigned int minor);
// static void setCurrentOGLVersion(unsigned int major,unsigned int minor);
/*
* search file in different path
......
......@@ -107,6 +107,14 @@ public:
QSize minimumSizeHint() const;
QSize sizeHint() const;
inline int pixelRatio() const
{
#if (QT_VERSION>>16) == 5
return this->devicePixelRatio();
#else
return 1;
#endif
}
};
......
......@@ -65,8 +65,6 @@ class CGoGN_UTILS_API GLWidget : public QGLWidget
public:
GLWidget(SimpleQT* cbs, QWidget *parent = 0);
GLWidget(SimpleQT* cbs, QGLFormat& format, QWidget *parent = 0);
~GLWidget();
QSize minimumSizeHint() const;
......@@ -250,6 +248,15 @@ protected:
* get the focale distance
*/
float getScale() { return scalefactor / foc; }
inline int pixelRatio() const
{
#if (QT_VERSION>>16) == 5
return this->devicePixelRatio();
#else
return 1;
#endif
}
};
} // namespace QT
......
......@@ -39,44 +39,43 @@ namespace CGoGN
namespace Utils
{
#ifdef CGOGN_USE_OGL_CORE_PROFILE
unsigned int GLSLShader::CURRENT_OGL_VERSION = 3;
unsigned int GLSLShader::MAJOR_OGL_CORE = 3;
unsigned int GLSLShader::MINOR_OGL_CORE = 3;
#else
unsigned int GLSLShader::CURRENT_OGL_VERSION = 2;
unsigned int GLSLShader::MAJOR_OGL_CORE = 2;
unsigned int GLSLShader::MINOR_OGL_CORE = 1;
#endif
std::string GLSLShader::DEFINES_GL2=\
"#version 110\n"
"#define PRECISION float pipo_PRECISION\n"
"#define ATTRIBUTE attribute\n"
"#define VARYING_VERT varying\n"
"#define VARYING_FRAG varying\n"
"#define FRAG_OUT_DEF float pipo_FRAGDEF\n"
"#define FRAG_OUT gl_FragColor\n"
"#define INVARIANT_POS float pipo_INVARIANT\n"
"#define TEXTURE2D texture2D\n"
;
std::string GLSLShader::DEFINES_GL3=\
"#version 150\n"
"#define PRECISION precision highp float\n"
"#define ATTRIBUTE in\n"
"#define VARYING_VERT out\n"
"#define VARYING_FRAG in\n"
"#define FRAG_OUT_DEF out vec4 outFragColor\n"
"#define FRAG_OUT outFragColor\n"
"#define INVARIANT_POS invariant gl_Position\n"
"#define TEXTURE2D texture\n";
std::string* GLSLShader::DEFINES_GL = NULL;
//#ifdef CGOGN_USE_OGL_CORE_PROFILE
//unsigned int GLSLShader::CURRENT_OGL_VERSION = 3;
//unsigned int GLSLShader::MAJOR_OGL_CORE = 3;
//unsigned int GLSLShader::MINOR_OGL_CORE = 3;
//#else
//unsigned int GLSLShader::CURRENT_OGL_VERSION = 2;
//unsigned int GLSLShader::MAJOR_OGL_CORE = 2;
//unsigned int GLSLShader::MINOR_OGL_CORE = 1;
//#endif
//std::string GLSLShader::DEFINES_GL2=\
//"#version 110\n"
//"#define PRECISION float pipo_PRECISION\n"
//"#define ATTRIBUTE attribute\n"
//"#define VARYING_VERT varying\n"
//"#define VARYING_FRAG varying\n"
//"#define FRAG_OUT_DEF float pipo_FRAGDEF\n"
//"#define FRAG_OUT gl_FragColor\n"
//"#define INVARIANT_POS float pipo_INVARIANT\n"
//"#define TEXTURE2D texture2D\n";
//std::string GLSLShader::DEFINES_GL3=\
//"#version 150\n"
//"#define PRECISION precision highp float\n"
//"#define ATTRIBUTE in\n"
//"#define VARYING_VERT out\n"
//"#define VARYING_FRAG in\n"
//"#define FRAG_OUT_DEF out vec4 outFragColor\n"
//"#define FRAG_OUT outFragColor\n"
//"#define INVARIANT_POS invariant gl_Position\n"
//"#define TEXTURE2D texture\n";
//std::string* GLSLShader::DEFINES_GL = NULL;
std::vector<std::string> GLSLShader::m_pathes;
......@@ -100,8 +99,8 @@ GLSLShader::GLSLShader() :
*m_uniMat_ModelProj = -1;
*m_uniMat_Normal = -1;
if (DEFINES_GL == NULL)
setCurrentOGLVersion(MAJOR_OGL_CORE,MINOR_OGL_CORE);
// if (DEFINES_GL == NULL)
// setCurrentOGLVersion(MAJOR_OGL_CORE,MINOR_OGL_CORE);
m_nbMaxVertices = 16;
......@@ -119,11 +118,36 @@ void GLSLShader::unregisterShader(void* ptr, GLSLShader* shader)
m_registeredShaders->erase(std::pair<void*,GLSLShader*>(ptr, shader));
}
std::string GLSLShader::defines_gl()
{
#ifdef CGOGN_USE_OGL_CORE_PROFILE
return std::string("#version 330\n\
#define PRECISION precision highp float\n\
#define ATTRIBUTE in\n\
#define VARYING_VERT out\n\
#define VARYING_FRAG in\n\
#define FRAG_OUT_DEF out vec4 outFragColor\n\
#define FRAG_OUT outFragColor\n\
#define INVARIANT_POS invariant gl_Position\n\
#define TEXTURE2D texture\n");
#else
return std::string("#version 110\n \
#define PRECISION float pipo_PRECISION\n\
#define ATTRIBUTE attribute\n\
#define VARYING_VERT varying\n\
#define VARYING_FRAG varying\n\
#define FRAG_OUT_DEF float pipo_FRAGDEF\n\
#define FRAG_OUT gl_FragColor\n\
#define INVARIANT_POS float pipo_INVARIANT\n\
#define TEXTURE2D texture2D\n");
#endif
}
std::string GLSLShader::defines_Geom(const std::string& primitivesIn, const std::string& primitivesOut, int maxVert)
{
if (CURRENT_OGL_VERSION >= 3)
{
std::string str("#version 150\n");
std::string str("#version 330\n");
str.append("precision highp float;\n");
str.append("layout (");
str.append(primitivesIn);
......@@ -1042,26 +1066,26 @@ void GLSLShader::unbindVA(const std::string& name)
CGoGNerr << "GLSLShader: Attribute "<<name<< " not binded"<< CGoGNendl;
}
void GLSLShader::setCurrentOGLVersion(unsigned int version)
{
CURRENT_OGL_VERSION = version;
switch(version)
{
case 2:
DEFINES_GL = &DEFINES_GL2;
break;
case 3:
DEFINES_GL = &DEFINES_GL3;
break;
}
}
void GLSLShader::setCurrentOGLVersion(unsigned int major,unsigned int minor)
{
setCurrentOGLVersion(major);
MAJOR_OGL_CORE = major;
MINOR_OGL_CORE = minor;
}
//void GLSLShader::setCurrentOGLVersion(unsigned int version)
//{
// CURRENT_OGL_VERSION = version;
// switch(version)
// {
// case 2:
// DEFINES_GL = &DEFINES_GL2;
// break;
// case 3:
// DEFINES_GL = &DEFINES_GL3;
// break;
// }
//}
//void GLSLShader::setCurrentOGLVersion(unsigned int major,unsigned int minor)
//{
// setCurrentOGLVersion(major);
// MAJOR_OGL_CORE = major;
// MINOR_OGL_CORE = minor;
//}
/**
* update projection, modelview, ... matrices
......
......@@ -53,7 +53,6 @@ SimpleQGLV::SimpleQGLV() :
m_modelView_matrix(m_mat.m_matrices[1]),
m_transfo_matrix(m_mat.m_matrices[2])
{
QGLFormat format;
if (GLSLShader::CURRENT_OGL_VERSION >= 3)
{
QGLFormat glFormat;
......
......@@ -167,15 +167,14 @@ void QGLView::mousePressEvent(QMouseEvent* event)
// clickPoint = event->pos();
m_current_button = event->button();
if (m_sqgl)
m_sqgl->cb_mousePress(event->button(), event->x(), getHeight() - event->y());
m_sqgl->cb_mousePress(event->button(), event->x()*pixelRatio(), getHeight() - event->y()*pixelRatio());
QGLViewer::mousePressEvent(event);
}
void QGLView::mouseReleaseEvent(QMouseEvent* event)
{
if (m_sqgl)
m_sqgl->cb_mouseRelease(event->button(), event->x(), getHeight() - event->y());
m_sqgl->cb_mouseRelease(event->button(), event->x()*pixelRatio(), getHeight() - event->y()*pixelRatio());
m_current_button = 0;
QGLViewer::mouseReleaseEvent(event);
}
......@@ -183,13 +182,13 @@ void QGLView::mouseReleaseEvent(QMouseEvent* event)
void QGLView::mouseClickEvent(QMouseEvent* event)
{
if (m_sqgl)
m_sqgl->cb_mouseClick(event->button(), event->x(), getHeight() - event->y());
m_sqgl->cb_mouseClick(event->button(), event->x()*pixelRatio(), getHeight() - event->y()*pixelRatio());
}
void QGLView::mouseMoveEvent(QMouseEvent* event)
{
if (m_sqgl)
m_sqgl->cb_mouseMove(m_current_button, event->x(), getHeight() - event->y());
m_sqgl->cb_mouseMove(m_current_button, event->x()*pixelRatio(), getHeight() - event->y()*pixelRatio());
QGLViewer::mouseMoveEvent(event);
}
......
......@@ -137,11 +137,14 @@ SimpleQT::SimpleQT(const SimpleQT& sqt):
{
if (GLSLShader::CURRENT_OGL_VERSION >= 3)
{
QGLFormat format = sqt.m_glWidget->format();
m_glWidget = new GLWidget(this,format);
QGLFormat glFormat;
glFormat.setVersion( Utils::GLSLShader::MAJOR_OGL_CORE, Utils::GLSLShader::MINOR_OGL_CORE);
glFormat.setProfile( QGLFormat::CoreProfile ); // Requires >=Qt-4.8.0
glFormat.setSampleBuffers( true );
QGLFormat::setDefaultFormat(glFormat);
}
else
m_glWidget = new GLWidget(this);
m_glWidget = new GLWidget(this);
setCentralWidget(m_glWidget);
......@@ -172,11 +175,14 @@ void SimpleQT::operator=(const SimpleQT& sqt)
{
if (GLSLShader::CURRENT_OGL_VERSION >= 3)
{
QGLFormat format = sqt.m_glWidget->format();
m_glWidget = new GLWidget(this,format);
QGLFormat glFormat;
glFormat.setVersion( Utils::GLSLShader::MAJOR_OGL_CORE, Utils::GLSLShader::MINOR_OGL_CORE);
glFormat.setProfile( QGLFormat::CoreProfile ); // Requires >=Qt-4.8.0
glFormat.setSampleBuffers( true );
QGLFormat::setDefaultFormat(glFormat);
}
else
m_glWidget = new GLWidget(this);
m_glWidget = new GLWidget(this);
setCentralWidget(m_glWidget) ;
......
......@@ -44,12 +44,7 @@ namespace QT
float GLWidget::FAR_PLANE = 500.0f;
GLWidget::GLWidget(SimpleQT* cbs, QWidget *parent) :
#ifdef MAC_OSX
// QGLWidget(new Core3_2_context(QGLFormat::defaultFormat()),parent),
QGLWidget(QGLFormat(QGL::Rgba | QGL::DoubleBuffer| QGL::DepthBuffer), parent),
#else
QGLWidget(QGLFormat(QGL::Rgba | QGL::DoubleBuffer| QGL::DepthBuffer), parent),
#endif
QGLWidget(parent),
m_cbs(cbs),
m_state_modifier(0),
allow_rotation(true)
......@@ -70,28 +65,6 @@ GLWidget::GLWidget(SimpleQT* cbs, QWidget *parent) :
}
GLWidget::GLWidget(SimpleQT* cbs, QGLFormat& format, QWidget *parent) :
QGLWidget(format, parent),
m_cbs(cbs),
m_state_modifier(0),
allow_rotation(true)
{
makeCurrent();
glewExperimental = GL_TRUE;
glewInit();
newModel = 1;
m_cbs->trans_x() = 0.;
m_cbs->trans_y() = 0.;
float f = FAR_PLANE;
m_cbs->trans_z() = -f / 5.0f;
foc = 2.0f;
// init trackball
trackball(m_cbs->curquat(), 0.0f, 0.0f, 0.0f, 0.0f);
}
GLWidget::~GLWidget()
{
}
......@@ -256,14 +229,14 @@ void GLWidget::mousePressEvent(QMouseEvent* event)
m_current_button = event->button();
if (m_cbs)
m_cbs->cb_mousePress(event->button(), event->x(), getHeight() - event->y());
m_cbs->cb_mousePress(event->button(), event->x()*pixelRatio(), getHeight() - event->y()*pixelRatio());
setFocus(Qt::MouseFocusReason);
}
void GLWidget::mouseReleaseEvent(QMouseEvent* event)
{
if (m_cbs)
m_cbs->cb_mouseRelease(event->button(), event->x(), getHeight() - event->y());
m_cbs->cb_mouseRelease(event->button(), event->x()*pixelRatio(), getHeight() - event->y()*pixelRatio());
if(event->pos() == clickPoint)
mouseClickEvent(event) ;
......@@ -273,15 +246,15 @@ void GLWidget::mouseClickEvent(QMouseEvent* event)
{
if (m_cbs)
m_cbs->cb_mouseClick(event->button(), event->x(), getHeight() - event->y());
m_cbs->cb_mouseClick(event->button(), event->x()*pixelRatio(), getHeight() - event->y()*pixelRatio());
}
void GLWidget::mouseDoubleClickEvent(QMouseEvent* event)
{
if (event->button()==1)
{
GLint x = event->x();
GLint y = getHeight() - event->y();
GLint x = event->x()*pixelRatio();
GLint y = getHeight() - event->y()*pixelRatio();
GLfloat depth;
glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
if (depth < 1.0f)
......
......@@ -45,10 +45,10 @@ ShaderColorPerVertex::ShaderColorPerVertex(bool withClipping, bool black_is_tran
m_nameFS = "ShaderColorPerVertexClip_fs";
m_nameGS = "";
std::string glxvert(*GLSLShader::DEFINES_GL);
std::string glxvert(GLSLShader::defines_gl());
glxvert.append(vertexShaderClipText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
std::string glxfrag(GLSLShader::defines_gl());
if (black_is_transparent)
glxfrag.append("#define BLACK_TRANSPARENCY 1\n");
glxfrag.append(fragmentShaderClipText);
......@@ -65,10 +65,10 @@ ShaderColorPerVertex::ShaderColorPerVertex(bool withClipping, bool black_is_tran
m_nameFS = "ShaderColorPerVertex_fs";
m_nameGS = "ShaderColorPerVertex_gs";
std::string glxvert(*GLSLShader::DEFINES_GL);
std::string glxvert(GLSLShader::defines_gl());
glxvert.append(vertexShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
std::string glxfrag(GLSLShader::defines_gl());
if (black_is_transparent)
glxfrag.append("#define BLACK_TRANSPARENCY 1\n");
glxfrag.append(fragmentShaderText);
......
......@@ -16,13 +16,13 @@ ShaderCustom::ShaderCustom()
m_nameFS = "ShaderCustom_fs";
m_nameGS = "ShaderCustom_gs";
std::string glxvert(*GLSLShader::DEFINES_GL);
std::string glxvert(GLSLShader::defines_gl());
glxvert.append(vertexShaderText);
std::string glxgeom = GLSLShader::defines_Geom("triangles", "triangle_strip", 3);
glxgeom.append(geometryShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
std::string glxfrag(GLSLShader::defines_gl());
glxfrag.append(fragmentShaderText);
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_TRIANGLES, GL_TRIANGLE_STRIP, 3);
......
......@@ -60,13 +60,13 @@ m_col(1)
m_nameFS = "ShaderCustomTex_fs";
m_nameGS = "ShaderCustomTex_gs";
std::string glxvert(*GLSLShader::DEFINES_GL);
std::string glxvert(GLSLShader::defines_gl());
glxvert.append(vertexShaderText);
std::string glxgeom = GLSLShader::defines_Geom("triangles", "triangle_strip", 3);
glxgeom.append(geometryShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
std::string glxfrag(GLSLShader::defines_gl());
glxfrag.append(fragmentShaderText);
// loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str());
......
......@@ -52,11 +52,11 @@ ShaderEnvMap::ShaderEnvMap(bool doubleSided, bool withEyePosition):
// get choose GL defines (2 or 3)
// ans compile shaders
std::string glxvert(*GLSLShader::DEFINES_GL);
std::string glxvert(GLSLShader::defines_gl());
if (m_with_eyepos)
glxvert.append("#define WITH_EYEPOSITION");
glxvert.append(vertexShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
std::string glxfrag(GLSLShader::defines_gl());
// Use double sided lighting if set
if (doubleSided)
glxfrag.append("#define DOUBLE_SIDED\n");
......@@ -171,10 +171,10 @@ unsigned int ShaderEnvMap::setAttributeColor(VBO* vbo)
{
m_with_color=true;
// set the define and recompile shader
std::string gl3vert(*GLSLShader::DEFINES_GL);
std::string gl3vert(GLSLShader::defines_gl());
gl3vert.append("#define WITH_COLOR 1\n");
gl3vert.append(vertexShaderText);
std::string gl3frag(*GLSLShader::DEFINES_GL);
std::string gl3frag(GLSLShader::defines_gl());
gl3frag.append("#define WITH_COLOR 1\n");
gl3frag.append(fragmentShaderText);
loadShadersFromMemory(gl3vert.c_str(), gl3frag.c_str());
......@@ -201,9 +201,9 @@ void ShaderEnvMap::unsetAttributeColor()
unbindVA("VertexColor");
unbind();
// recompile shader
std::string gl3vert(*GLSLShader::DEFINES_GL);
std::string gl3vert(GLSLShader::defines_gl());
gl3vert.append(vertexShaderText);
std::string gl3frag(*GLSLShader::DEFINES_GL);
std::string gl3frag(GLSLShader::defines_gl());
gl3frag.append(fragmentShaderText);
loadShadersFromMemory(gl3vert.c_str(), gl3frag.c_str());
// and treat uniforms
......
......@@ -44,7 +44,7 @@ ShaderExplodeSmoothVolumes::ShaderExplodeSmoothVolumes(bool withColorPerFace, bo
m_nameFS = "ShaderExplodeSmoothVolumes_fs";
m_nameGS = "ShaderExplodeSmoothVolumes_gs";
std::string glxvert(*GLSLShader::DEFINES_GL);
std::string glxvert(GLSLShader::defines_gl());
glxvert.append(vertexShaderText);
std::string glxgeom;
......@@ -56,7 +56,7 @@ ShaderExplodeSmoothVolumes::ShaderExplodeSmoothVolumes(bool withColorPerFace, bo
glxgeom.append("#define WITH_EXPLODE_FACE 1\n");
glxgeom.append(geometryShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
std::string glxfrag(GLSLShader::defines_gl());
glxfrag.append(fragmentShaderText);
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_LINES_ADJACENCY_EXT , GL_TRIANGLE_STRIP,4);
......
......@@ -44,7 +44,7 @@ ShaderExplodeVolumes::ShaderExplodeVolumes(bool withColorPerFace, bool withExplo
m_nameFS = "ShaderExplodeVolumes_fs";
m_nameGS = "ShaderExplodeVolumes_gs";
std::string glxvert(*GLSLShader::DEFINES_GL);
std::string glxvert(GLSLShader::defines_gl());
glxvert.append(vertexShaderText);
std::string glxgeom;
......@@ -56,7 +56,7 @@ ShaderExplodeVolumes::ShaderExplodeVolumes(bool withColorPerFace, bool withExplo
glxgeom.append("#define WITH_EXPLODE_FACE 1\n");
glxgeom.append(geometryShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
std::string glxfrag(GLSLShader::defines_gl());
glxfrag.append(fragmentShaderText);
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_LINES_ADJACENCY_EXT , GL_TRIANGLE_STRIP,4);
......
......@@ -42,13 +42,13 @@ ShaderExplodeVolumesLines::ShaderExplodeVolumesLines()
m_nameFS = "ShaderExplodeVolumesLines_fs";
m_nameGS = "ShaderExplodeVolumesLines_gs";
std::string glxvert(*GLSLShader::DEFINES_GL);
std::string glxvert(GLSLShader::defines_gl());
glxvert.append(vertexShaderText);
std::string glxgeom(GLSLShader::defines_Geom("triangles", "line_strip", 4));
glxgeom.append(geometryShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
std::string glxfrag(GLSLShader::defines_gl());
glxfrag.append(fragmentShaderText);
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_TRIANGLES , GL_LINE_STRIP,4);
......
......@@ -42,13 +42,13 @@ ShaderFlat::ShaderFlat()
m_nameFS = "ShaderFlat_fs";
m_nameGS = "ShaderFlat_gs";
std::string glxvert(*GLSLShader::DEFINES_GL);
std::string glxvert(GLSLShader::defines_gl());
glxvert.append(vertexShaderText);
std::string glxgeom = GLSLShader::defines_Geom("triangles", "triangle_strip", 3);
glxgeom.append(geometryShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
std::string glxfrag(GLSLShader::defines_gl());
glxfrag.append(fragmentShaderText);
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_TRIANGLES, GL_TRIANGLE_STRIP, 3);
......
......@@ -41,7 +41,7 @@ ShaderFlatColor::ShaderFlatColor(bool averageColor)
m_nameFS = "shaderFlatColor_fs";
m_nameGS = "shaderFlatColor_gs";
std::string glxvert(*GLSLShader::DEFINES_GL);
std::string glxvert(GLSLShader::defines_gl());
glxvert.append(vertexShaderText);