]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix compilation error.
authorrnv <rnv@opencascade.com>
Tue, 6 Sep 2016 07:15:28 +0000 (10:15 +0300)
committerrnv <rnv@opencascade.com>
Tue, 6 Sep 2016 07:15:28 +0000 (10:15 +0300)
src/VTKViewer/VTKViewer_OpenGLHelper.cxx
src/VTKViewer/VTKViewer_OpenGLHelper.h
src/VTKViewer/VTKViewer_PolyDataMapper.cxx

index b92c14dc9f2efd0ff8efff3f71132e9b583978a4..7be1e8b881118421892446653afad00de0739e17 100644 (file)
@@ -205,7 +205,7 @@ void VTKViewer_OpenGLHelper::Init()
   return;
 }
 
-namespace
+namespace GUI_OPENGL
 {
        char* readFromFile( std::string fileName )
        {
@@ -257,7 +257,7 @@ bool VTKViewer_OpenGLHelper::CreateShaderProgram (const std::string& theFilePath
   // 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);
@@ -281,7 +281,7 @@ bool VTKViewer_OpenGLHelper::CreateShaderProgram (const std::string& theFilePath
   // 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);
@@ -349,6 +349,7 @@ void VTKViewer_OpenGLHelper::DestroyShaderProgram (GLhandleARB theProgram,
 // function : SetUniformMatrix
 // purpose  :
 // ============================================================================
+#ifdef VTK_OPENGL2
 void VTKViewer_OpenGLHelper::SetUniformMatrix (const GLint         theLocation,
                                                const vtkMatrix4x4* theMatrix) const
 {
@@ -360,3 +361,4 @@ void VTKViewer_OpenGLHelper::SetUniformMatrix (const GLint         theLocation,
 
   this->vglUniformMatrix4fvARB (theLocation, 1, GL_FALSE, data);
 }
+#endif
index 26333be2d2d7481ad532c7f12b8bea533daa294c..3a6c9d43417a0fb6664c6ad286f886059047b8e8 100644 (file)
@@ -66,6 +66,11 @@ typedef ptrdiff_t GLsizeiptrARB;
 #define GL_STATIC_DRAW_ARB                0x88E4
 #endif
 
+
+namespace GUI_OPENGL {
+char* readFromFile( std::string fileName );
+}
+
 class VTKVIEWER_EXPORT VTKViewer_OpenGLHelper
 {
 public:
@@ -85,9 +90,10 @@ 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);
index 3f08ccfbbd793f83ee677e11f5a5f8d2f74a61a5..35dedc6fb392cb372fd1f7ab2cfb05f56f8b3e44 100644 (file)
@@ -136,7 +136,7 @@ int VTKViewer_PolyDataMapper::InitShader()
   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 );
@@ -974,7 +974,7 @@ void VTKViewer_PolyDataMapper::InternalDraw(vtkRenderer* ren, vtkActor* act ) {
          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(