Commit bab67f6f authored by Sylvain Thery's avatar Sylvain Thery

rendering modification for support of VRJuggler (use multi context option)

parent 44a7a94f
......@@ -19,6 +19,8 @@ SET ( WITH_NUMERICAL ON CACHE BOOL "build CGoGN with Numerical libs support ")
SET ( FORCE_MR "0" CACHE STRING "0: normal mode / 1 multires mode")
#create one big lib
SET ( ONELIB OFF CACHE BOOL "build CGoGN in one lib")
SET ( WITH_GLEWMX OFF CACHE BOOL "use multi-contex GLEW")
IF(WIN32)
set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
......@@ -54,6 +56,15 @@ ELSE (ONELIB)
file(WRITE ${CGoGN_ROOT_DIR}/include/cgogn_onelib.h "0" )
ENDIF (ONELIB)
IF (WITH_GLEWMX)
file(WRITE ${CGoGN_ROOT_DIR}/include/cgogn_gmx.h "1" )
ELSE (WITH_GLEWMX)
file(WRITE ${CGoGN_ROOT_DIR}/include/cgogn_gmx.h "0" )
ENDIF (WITH_GLEWMX)
add_definitions(-DSHADERPATH="${CGoGN_ROOT_DIR}/lib/Shaders/")
# define includes of external libs
......@@ -100,6 +111,10 @@ IF (WITH_QT)
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} ${QT_LIBRARIES} )
ENDIF (WITH_QT)
IF (WITH_GLEWMX)
ADD_DEFINITIONS(-DGLEW_MX)
ENDIF (WITH_GLEWMX)
#IF (WITH_NUMERICAL)
# add_definitions(-DWITH_NUMERICAL)
# SET (CGoGN_NUMERICAL_INCLUDES ${CGoGN_ROOT_DIR}/ThirdParty/Numerical ${CGoGN_ROOT_DIR}/ThirdParty/Numerical/UFconfig)
......
......@@ -8,7 +8,7 @@ IF(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
ADD_DEFINITIONS(-DNOTOPOWARNING)
ENDIF(WIN32)
include_directories(
......
......@@ -29,6 +29,7 @@
#ifndef __CGoGN_GLSL_SHADER__
#define __CGoGN_GLSL_SHADER__
#include "Utils/gl_def.h"
#include "Utils/os_spec.h"
#include "Utils/vbo.h"
#include "Utils/gl_matrices.h"
......@@ -41,6 +42,7 @@
#include <vector>
#include <set>
namespace CGoGN
{
......@@ -80,17 +82,17 @@ protected:
/**
* handle of vertex shader
*/
GLhandleARB m_vertex_shader_object;
CGoGNGLhandleARB m_vertex_shader_object;
/**
* handle of fragment shader
*/
GLhandleARB m_fragment_shader_object;
CGoGNGLhandleARB m_fragment_shader_object;
/**
* handle of geometry shader
*/
GLhandleARB m_geom_shader_object;
CGoGNGLhandleARB m_geom_shader_object;
std::string m_nameVS;
std::string m_nameFS;
......@@ -99,12 +101,12 @@ protected:
/**
* handle of program
*/
GLhandleARB m_program_object;
CGoGNGLhandleARB m_program_object;
GLint m_uniMat_Proj;
GLint m_uniMat_Model;
GLint m_uniMat_ModelProj;
GLint m_uniMat_Normal;
CGoGNGLint m_uniMat_Proj;
CGoGNGLint m_uniMat_Model;
CGoGNGLint m_uniMat_ModelProj;
CGoGNGLint m_uniMat_Normal;
char* m_vertex_shader_source;
char* m_fragment_shader_source;
......@@ -296,7 +298,7 @@ public:
/**
* get handler of program for external use og gl functions
*/
GLuint program_handler() { return m_program_object;}
GLhandleARB program_handler() { return *m_program_object;}
/**
* check shader validity width official GLSL syntax
......@@ -379,6 +381,9 @@ public:
*/
void disableVertexAttribs() const;
/// get back OpenGL standard matrices & send to all shaders
static void updateAllFromGLMatrices();
/// sent current matrices to all shaders
static void updateCurrentMatrices();
/// get current transformation matrix
......@@ -400,13 +405,13 @@ public:
inline bool GLSLShader::isCreated()
{
return ( m_program_object != 0 );
return ( *m_program_object != 0 );
}
template<unsigned int NB>
void GLSLShader::setuniformf( const char* name, const float* val)
{
GLint uni = glGetUniformLocationARB(m_program_object,name);
GLint uni = glGetUniformLocationARB(*m_program_object,name);
if (uni >= 0)
{
switch(NB)
......@@ -433,7 +438,7 @@ void GLSLShader::setuniformf( const char* name, const float* val)
template<unsigned int NB>
void GLSLShader::setuniformi( const char* name, const int* val)
{
GLint uni = glGetUniformLocationARB(m_program_object,name);
GLint uni = glGetUniformLocationARB(*m_program_object,name);
if (uni>=0)
{
switch(NB)
......
......@@ -43,12 +43,12 @@ protected:
static std::string geometryShaderText;
// uniform locations
GLuint m_unif_ambiant;
GLuint m_unif_backColor;
GLuint m_unif_lightPos;
GLuint m_unif_explodeV;
GLuint m_unif_explodeF;
GLuint m_unif_plane;
CGoGNGLuint m_unif_ambiant;
CGoGNGLuint m_unif_backColor;
CGoGNGLuint m_unif_lightPos;
CGoGNGLuint m_unif_explodeV;
CGoGNGLuint m_unif_explodeF;
CGoGNGLuint m_unif_plane;
// local storage for uniforms
float m_explodeV;
......
......@@ -43,9 +43,9 @@ protected:
static std::string geometryShaderText;
// uniform locations
GLuint m_unif_color;
GLuint m_unif_explodeV;
GLuint m_unif_plane;
CGoGNGLuint m_unif_color;
CGoGNGLuint m_unif_explodeV;
CGoGNGLuint m_unif_plane;
float m_explodeV;
Geom::Vec4f m_color;
......
......@@ -43,10 +43,10 @@ protected:
static std::string geometryShaderText;
// uniform locations
GLuint m_unif_ambiant;
GLuint m_unif_diffuse;
GLuint m_unif_lightPos;
GLuint m_unif_explode;
CGoGNGLuint m_unif_ambiant;
CGoGNGLuint m_unif_diffuse;
CGoGNGLuint m_unif_lightPos;
CGoGNGLuint m_unif_explode;
float m_explode;
Geom::Vec4f m_ambiant;
......
......@@ -43,9 +43,9 @@ protected:
static std::string geometryShaderText;
// uniform locations
GLuint m_unif_ambiant;
GLuint m_unif_lightPos;
GLuint m_unif_explode;
CGoGNGLuint m_unif_ambiant;
CGoGNGLuint m_unif_lightPos;
CGoGNGLuint m_unif_explode;
float m_explode;
Geom::Vec4f m_ambiant;
......
......@@ -48,11 +48,11 @@ protected:
static std::string fragmentShaderText;
// uniform locations
GLuint m_unif_ambiant;
GLuint m_unif_diffuse;
GLuint m_unif_specular;
GLuint m_unif_shininess;
GLuint m_unif_lightPos;
CGoGNGLuint m_unif_ambiant;
CGoGNGLuint m_unif_diffuse;
CGoGNGLuint m_unif_specular;
CGoGNGLuint m_unif_shininess;
CGoGNGLuint m_unif_lightPos;
//values
Geom::Vec4f m_ambiant;
......
......@@ -43,7 +43,7 @@ protected:
static std::string fragmentShaderText;
// uniform locations
GLuint m_unif_color;
CGoGNGLuint m_unif_color;
Geom::Vec4f m_color;
......
......@@ -44,7 +44,7 @@ protected:
static std::string vertexShaderText;
static std::string fragmentShaderText;
GLuint m_unif_unit;
CGoGNGLuint m_unif_unit;
int m_unit;
......
......@@ -44,9 +44,9 @@ protected:
static std::string vertexShaderText;
static std::string fragmentShaderText;
GLuint m_unif_unit;
CGoGNGLuint m_unif_unit;
int m_unit;
GLuint m_unif_unitMask;
CGoGNGLuint m_unif_unitMask;
int m_unitMask;
Utils::GTexture* m_tex_ptr;
......
......@@ -42,8 +42,8 @@ protected:
static std::string geometryShaderText;
static std::string fragmentShaderText;
GLuint m_uniform_scale;
GLuint m_uniform_color;
CGoGNGLuint m_uniform_scale;
CGoGNGLuint m_uniform_color;
float m_scale;
Geom::Vec4f m_color;
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __CGOGN_GL_DEF_H_
#define __CGOGN_GL_DEF_H_
#ifdef USE_VRJUGGLER
#include <vrj/Draw/OGL/GlApp.h>
#include <vrj/Draw/OGL/GlContextData.h>
#endif
#include <GL/glew.h>
namespace CGoGN
{
#ifdef USE_VRJUGGLER
#include <vrj/Draw/OGL/GlApp.h>
#include <vrj/Draw/OGL/GlContextData.h>
typedef vrj::opengl::ContextData<GLint> CGoGNGLint;
typedef vrj::opengl::ContextData<GLuint> CGoGNGLuint;
typedef vrj::opengl::ContextData<GLhandleARB> CGoGNGLhandleARB;
#else
template <typename T>
class FalsePtr
{
T m_v;
public:
FalsePtr() :m_v(T(0)) {}
FalsePtr(const T& v) : m_v(v) {}
T& operator*() { return m_v; }
const T& operator*() const { return m_v; }
};
typedef FalsePtr<GLint> CGoGNGLint;
typedef FalsePtr<GLuint> CGoGNGLuint;
typedef FalsePtr<GLhandleARB> CGoGNGLhandleARB;
#endif
}
#endif /* GL_DEF_H_ */
......@@ -44,7 +44,7 @@ protected:
/**
* id of indices VBO
*/
GLuint m_ind;
CGoGNGLuint m_ind;
/**
* VBO for position
......
......@@ -47,18 +47,20 @@ protected:
static std::string fragmentShaderText;
static GLuint m_idTexture;
static GLuint m_uniform_texture;
static unsigned char* m_ptrSphere;
static PointSprite* m_instance0;
// compute the sphere instead of storing it in image file.
static void computeSphere();
GLuint m_uniform_size;
CGoGNGLuint m_uniform_size;
CGoGNGLuint m_uniform_color;
CGoGNGLuint m_idTexture;
GLuint m_uniform_color;
CGoGNGLuint m_uniform_texture;
public:
/**
......
......@@ -55,7 +55,7 @@ protected:
static std::string fragmentShaderText1;
static std::string fragmentShaderText2;
static GLuint m_idTexture;
static Strings3D* m_instance0;
std::vector<std::string> m_strings;
......@@ -71,13 +71,15 @@ protected:
unsigned int sendOneStringToVBO(const std::string& str, float **buffer);
GLuint m_uniform_texture;
CGoGNGLuint m_idTexture;
GLuint m_uniform_scale;
CGoGNGLuint m_uniform_texture;
GLuint m_uniform_position;
CGoGNGLuint m_uniform_scale;
GLuint m_uniform_color;
CGoGNGLuint m_uniform_position;
CGoGNGLuint m_uniform_color;
public:
Strings3D(bool withBackground = true, const Geom::Vec3f& bgc = Geom::Vec3f(0));
......
......@@ -25,6 +25,7 @@
#ifndef CGOGN_TEXTURES_H_
#define CGOGN_TEXTURES_H_
#include "Utils/gl_def.h"
#include "Geometry/vector_gen.h"
#include <GL/glew.h>
#include <string>
......@@ -309,7 +310,7 @@ protected:
/**
* texture id
*/
GLuint m_id;
CGoGNGLuint m_id;
/**
* dimension of texture
......
......@@ -915,9 +915,9 @@ m_type(type)
break;
}
glGenTextures(1, &m_id);
glGenTextures(1, &(*m_id));
glBindTexture(m_target, m_id);
glBindTexture(m_target, *m_id);
glTexParameteri(m_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(m_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
......@@ -963,7 +963,7 @@ GLenum Texture<DIM,TYPE>::internalFormat()
template < unsigned int DIM, typename TYPE >
void Texture<DIM,TYPE>::bind()
{
glBindTexture(m_target, m_id);
glBindTexture(m_target, *m_id);
}
......@@ -983,7 +983,7 @@ void Texture<DIM,TYPE>::checkAlignment()
template < unsigned int DIM, typename TYPE >
void Texture<DIM,TYPE>::update()
{
glBindTexture(m_target, m_id);
glBindTexture(m_target, *m_id);
checkAlignment();
switch(DIM)
{
......@@ -1005,7 +1005,7 @@ void Texture<DIM,TYPE>::update()
template < unsigned int DIM, typename TYPE >
void Texture<DIM,TYPE>::update(const COORD& origin, const COORD& sz)
{
glBindTexture(m_target, m_id);
glBindTexture(m_target, *m_id);
checkAlignment();
switch(DIM)
{
......@@ -1028,7 +1028,7 @@ void Texture<DIM,TYPE>::update(const COORD& origin, const COORD& sz)
template < unsigned int DIM, typename TYPE >
void Texture<DIM,TYPE>::setFiltering(GLint param)
{
glBindTexture(m_target, m_id);
glBindTexture(m_target, *m_id);
glTexParameteri(m_target, GL_TEXTURE_MIN_FILTER, param);
glTexParameteri(m_target, GL_TEXTURE_MAG_FILTER, param);
}
......@@ -1038,7 +1038,7 @@ void Texture<DIM,TYPE>::setFiltering(GLint param)
template < unsigned int DIM, typename TYPE >
void Texture<DIM,TYPE>::setWrapping(GLint param)
{
glBindTexture(m_target, m_id);
glBindTexture(m_target, *m_id);
glTexParameteri(m_target, GL_TEXTURE_WRAP_S, param);
glTexParameteri(m_target, GL_TEXTURE_WRAP_T, param);
glTexParameteri(m_target, GL_TEXTURE_WRAP_R, param);
......
......@@ -25,9 +25,10 @@
#ifndef __CGoGN_GLSL_VBO__
#define __CGoGN_GLSL_VBO__
#include <vector>
#include <GL/glew.h>
#include "Utils/gl_def.h"
#include "Topology/generic/attributeHandler.h"
#include "Container/convert.h"
......@@ -50,7 +51,7 @@ class VBO
{
protected:
// VBO id
GLuint m_id;
CGoGNGLuint m_id;
// size of data (in floats)
unsigned int m_data_size;
// shaders that ref this vbo
......@@ -77,7 +78,7 @@ public:
/**
* get id of vbo
*/
unsigned int id() const { return m_id; }
GLuint id() const { return *m_id; }
/**
* get dataSize
......@@ -97,7 +98,7 @@ public:
/**
* bind array vbo
*/
void bind() const { glBindBuffer(GL_ARRAY_BUFFER, m_id); }
void bind() const { glBindBuffer(GL_ARRAY_BUFFER, *m_id); }
/**
* alloc buffer of same size than parameter
......
......@@ -43,7 +43,7 @@ void VBO::updateData(const ATTR_HANDLER& attrib)
unsigned int byteTableSize;
unsigned int nbb = mv->getBlocksPointers(addr, byteTableSize);
glBindBuffer(GL_ARRAY_BUFFER, m_id);
glBindBuffer(GL_ARRAY_BUFFER, *m_id);
glBufferData(GL_ARRAY_BUFFER, nbb * byteTableSize, 0, GL_STREAM_DRAW);
m_nbElts = nbb * byteTableSize / sizeof(typename ATTR_HANDLER::DATA_TYPE);
......@@ -76,7 +76,7 @@ void VBO::updateData(const ATTR_HANDLER& attrib, ConvertAttrib* conv)
conv->reserve(mv->getBlockSize());
// bind buffer to update
glBindBuffer(GL_ARRAY_BUFFER, m_id);
glBindBuffer(GL_ARRAY_BUFFER, *m_id);
glBufferData(GL_ARRAY_BUFFER, nbb * conv->sizeBuffer(), 0, GL_STREAM_DRAW);
m_nbElts = nbb * conv->nbElt();
......@@ -108,7 +108,7 @@ void VBO::updateData(std::vector<T>& data)
m_data_size = sizeof(T) / sizeof(float);
m_nbElts = data.size();
glBindBuffer(GL_ARRAY_BUFFER, m_id);
glBindBuffer(GL_ARRAY_BUFFER, *m_id);
glBufferData(GL_ARRAY_BUFFER, m_nbElts * sizeof(T), &(data[0]), GL_STREAM_DRAW);
}
......
......@@ -39,14 +39,14 @@ namespace GL2
MapRender::MapRender()
{
glGenBuffersARB(SIZE_BUFFER, m_indexBuffers) ;
glGenBuffers(SIZE_BUFFER, m_indexBuffers) ;
for(unsigned int i = 0; i < SIZE_BUFFER; ++i)
m_nbIndices[i] = 0 ;
}
MapRender::~MapRender()
{
glDeleteBuffersARB(4, m_indexBuffers);
glDeleteBuffers(4, m_indexBuffers);
}
void MapRender::initPrimitives(int prim, std::vector<GLuint>& tableIndices)
......@@ -83,8 +83,8 @@ void MapRender::initPrimitives(int prim, std::vector<GLuint>& tableIndices)
}
// setup du buffer d'indices
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, vbo_ind);
glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER, size * sizeof(GLuint), &(tableIndices[0]), GL_STREAM_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo_ind);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, size * sizeof(GLuint), &(tableIndices[0]), GL_STREAM_DRAW);
}
void MapRender::draw(Utils::GLSLShader* sh, int prim)
......
This diff is collapsed.
......@@ -75,12 +75,12 @@ m_wcpf(withColorPerFace), m_wef(withExplodeFace)
void ShaderExplodeVolumes::getLocations()
{
m_unif_explodeV = glGetUniformLocation(program_handler(),"explodeV");
m_unif_explodeF = glGetUniformLocation(program_handler(),"explodeF");
m_unif_ambiant = glGetUniformLocation(program_handler(),"ambient");
m_unif_backColor = glGetUniformLocation(program_handler(),"backColor");
m_unif_lightPos = glGetUniformLocation(program_handler(),"lightPosition");
m_unif_plane = glGetUniformLocation(program_handler(),"plane");
*m_unif_explodeV = glGetUniformLocation(program_handler(),"explodeV");
*m_unif_explodeF = glGetUniformLocation(program_handler(),"explodeF");
*m_unif_ambiant = glGetUniformLocation(program_handler(),"ambient");
*m_unif_backColor = glGetUniformLocation(program_handler(),"backColor");
*m_unif_lightPos = glGetUniformLocation(program_handler(),"lightPosition");
*m_unif_plane = glGetUniformLocation(program_handler(),"plane");
}
void ShaderExplodeVolumes::setAttributePosition(VBO* vbo)
......@@ -99,19 +99,19 @@ void ShaderExplodeVolumes::setParams(float explV, float explF, const Geom::Vec4f
{
bind();
m_explodeV = explV;
glUniform1f(m_unif_explodeV, explV);
glUniform1f(*m_unif_explodeV, explV);
m_explodeF = explF;
glUniform1f(m_unif_explodeF, explF);
glUniform1f(*m_unif_explodeF, explF);
m_ambiant = ambiant;
glUniform4fv(m_unif_ambiant, 1, ambiant.data());
glUniform4fv(*m_unif_ambiant, 1, ambiant.data());
m_backColor = backColor;
glUniform4fv(m_unif_backColor, 1, backColor.data());
glUniform4fv(*m_unif_backColor, 1, backColor.data());
m_light_pos = lightPos;
glUniform3fv(m_unif_lightPos, 1, lightPos.data());
glUniform3fv(*m_unif_lightPos, 1, lightPos.data());
m_plane = plane;
glUniform4fv(m_unif_plane, 1, m_plane.data());
glUniform4fv(*m_unif_plane, 1, m_plane.data());
unbind(); // ??
}
......@@ -121,14 +121,14 @@ void ShaderExplodeVolumes::setExplodeVolumes(float explode)
{
m_explodeV = explode;
bind();
glUniform1f(m_unif_explodeV, explode);
glUniform1f(*m_unif_explodeV, explode);
}
void ShaderExplodeVolumes::setExplodeFaces(float explode)
{
m_explodeF = explode;
bind();
glUniform1f(m_unif_explodeF, explode);
glUniform1f(*m_unif_explodeF, explode);
}
......@@ -136,21 +136,21 @@ void ShaderExplodeVolumes::setAmbiant(const Geom::Vec4f& ambiant)
{
m_ambiant = ambiant;
bind();
glUniform4fv(m_unif_ambiant,1, ambiant.data());
glUniform4fv(*m_unif_ambiant,1, ambiant.data());
}
void ShaderExplodeVolumes::setBackColor(const Geom::Vec4f& backColor)
{
m_backColor = backColor;
bind();
glUniform4fv(m_unif_backColor, 1, backColor.data());
glUniform4fv(*m_unif_backColor, 1, backColor.data());
}
void ShaderExplodeVolumes::setLightPosition(const Geom::Vec3f& lp)
{
m_light_pos = lp;
bind();
glUniform3fv(m_unif_lightPos,1,lp.data());
glUniform3fv(*m_unif_lightPos,1,lp.data());
}
......@@ -158,7 +158,7 @@ void ShaderExplodeVolumes::setClippingPlane(const Geom::Vec4f& plane)
{
m_plane = plane;
bind();
glUniform4fv(m_unif_plane,1, plane.data());
glUniform4fv(*m_unif_plane,1, plane.data());
}
......@@ -166,23 +166,23 @@ void ShaderExplodeVolumes::restoreUniformsAttribs()
{
bind();
m_unif_explodeV = glGetUniformLocation(program_handler(),"explodeV");
glUniform1f (m_unif_explodeV, m_explodeV);
*m_unif_explodeV = glGetUniformLocation(program_handler(),"explodeV");
glUniform1f (*m_unif_explodeV, m_explodeV);
m_unif_explodeF = glGetUniformLocation(program_handler(),"explodeF");
glUniform1f (m_unif_explodeF, m_explodeF);
*m_unif_explodeF = glGetUniformLocation(program_handler(),"explodeF");
glUniform1f (*m_unif_explodeF, m_explodeF);
m_unif_ambiant = glGetUniformLocation(program_handler(),"ambient");
glUniform4fv(m_unif_ambiant, 1, m_ambiant.data());
*m_unif_ambiant = glGetUniformLocation(program_handler(),"ambient");
glUniform4fv(*m_unif_ambiant, 1, m_ambiant.data());
m_unif_backColor = glGetUniformLocation(program_handler(),"backColor");
glUniform4fv(m_unif_backColor, 1, m_backColor.data());
*m_unif_backColor = glGetUniformLocation(program_handler(),"backColor");
glUniform4fv(*m_unif_backColor, 1, m_backColor.data());
m_unif_lightPos = glGetUniformLocation(program_handler(),"lightPosition");
glUniform3fv(m_unif_lightPos, 1, m_light_pos.data());
*m_unif_lightPos = glGetUniformLocation(program_handler(),"lightPosition");
glUniform3fv(*m_unif_lightPos, 1, m_light_pos.data());
m_unif_plane = glGetUniformLocation(program_handler(),"plane");
glUniform4fv(m_unif_plane, 1, m_plane.data());
*m_unif_plane = glGetUniformLocation(program_handler(),"plane");
glUniform4fv(*m_unif_plane, 1, m_plane.data());
bindVA_VBO("VertexPosition", m_vboPos);
bindVA_VBO("VertexColor", m_vboColors);
......
......@@ -64,9 +64,9 @@ ShaderExplodeVolumesLines::ShaderExplodeVolumesLines()
void ShaderExplodeVolumesLines::getLocations()
{
m_unif_explodeV = glGetUniformLocation(program_handler(),"explodeV");
m_unif_color = glGetUniformLocation(program_handler(),"color");
m_unif_plane = glGetUniformLocation(program_handler(),"plane");
*m_unif_explodeV = glGetUniformLocation(program_handler(),"explodeV");
*m_unif_color = glGetUniformLocation(program_handler(),"color");
*m_unif_plane = glGetUniformLocation(program_handler(),"plane");
}
void ShaderExplodeVolumesLines::setAttributePosition(VBO* vbo)
......@@ -83,9 +83,9 @@ void ShaderExplodeVolumesLines::setParams(float explV, const Geom::Vec4f& color,
bind();
glUniform1f(m_unif_explodeV, explV);
glUniform4fv(m_unif_color, 1, color.data());
glUniform4fv(m_unif_plane, 1, m_plane.data());
glUniform1f(*m_unif_explodeV, explV);
glUniform4fv(*m_unif_color, 1, color.data());
glUniform4fv(*m_unif_plane, 1, m_plane.data());
unbind(); // ??
}
......@@ -93,7 +93,7 @@ void ShaderExplodeVolumesLines::setExplodeVolumes(float explode)
{
m_explodeV = explode;
bind();
glUniform1f(m_unif_explodeV, explode);
glUniform1f(*m_unif_explodeV, explode);
}
......@@ -101,26 +101,26 @@ void