return;
}
-namespace
+namespace GUI_OPENGL
{
char* readFromFile( std::string fileName )
{
// Create vertex shader.
fileName = theFilePath + ".vs.glsl";
- shaderContent = readFromFile (fileName);
+ shaderContent = GUI_OPENGL::readFromFile (fileName);
theVertexShader = vglCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
vglShaderSourceARB (theVertexShader, 1, (const GLcharARB**)&shaderContent, NULL);
// Create fragment shader.
fileName = theFilePath + ".fs.glsl";
- shaderContent = readFromFile (fileName);
+ shaderContent = GUI_OPENGL::readFromFile (fileName);
theFragmentShader = vglCreateShaderObjectARB (GL_FRAGMENT_SHADER_ARB);
vglShaderSourceARB (theFragmentShader, 1, (const GLcharARB**)&shaderContent, NULL);
// function : SetUniformMatrix
// purpose :
// ============================================================================
+#ifdef VTK_OPENGL2
void VTKViewer_OpenGLHelper::SetUniformMatrix (const GLint theLocation,
const vtkMatrix4x4* theMatrix) const
{
this->vglUniformMatrix4fvARB (theLocation, 1, GL_FALSE, data);
}
+#endif
#define GL_STATIC_DRAW_ARB 0x88E4
#endif
+
+namespace GUI_OPENGL {
+char* readFromFile( std::string fileName );
+}
+
class VTKVIEWER_EXPORT VTKViewer_OpenGLHelper
{
public:
void DestroyShaderProgram (GLhandleARB theProgram,
GLhandleARB theVertexShader,
GLhandleARB theFragmentShader) const;
-
+#ifdef VTK_OPENGL2
void SetUniformMatrix (const GLint theLocation,
const vtkMatrix4x4* theMatrix) const;
+#endif
protected:
typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
std::string fileName = std::string( getenv( "GUI_ROOT_DIR") ) +
"/share/salome/resources/gui/Vertex_Program_ARB.txt";
- char* shader = readFromFile( fileName );
+ char* shader = GUI_OPENGL::readFromFile( fileName );
GLhandleARB VertexShader = this->OpenGLHelper.vglCreateShaderObjectARB( GL_VERTEX_SHADER_ARB );
this->OpenGLHelper.vglShaderSourceARB( VertexShader, 1, (const GLcharARB**)&shader, NULL );
this->OpenGLHelper.vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
this->OpenGLHelper.vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aDiamsID );
- attribute_diams = vglGetAttribLocationARB(this->PointProgram, "diameter");
+ attribute_diams = this->OpenGLHelper.vglGetAttribLocationARB(this->PointProgram, "diameter");
this->OpenGLHelper.vglEnableVertexAttribArrayARB(attribute_diams);
this->OpenGLHelper.vglBindBufferARB(GL_ARRAY_BUFFER_ARB, aDiamsID);
this->OpenGLHelper.vglVertexAttribPointerARB(