]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
GVIEW12830
authorouv <ouv@opencascade.com>
Mon, 4 Sep 2006 12:40:58 +0000 (12:40 +0000)
committerouv <ouv@opencascade.com>
Mon, 4 Sep 2006 12:40:58 +0000 (12:40 +0000)
src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx

index 344006009ee7bd3435e5b2f482ff1fc7650bcc20..401ca646479eba4904df0cae97dc5e81f81de347 100755 (executable)
@@ -51,6 +51,8 @@
 #include <cmath>
 #include <string>
 
+#include <GL/glx.h>
+
 #ifndef VTK_IMPLEMENT_MESA_CXX
 vtkCxxRevisionMacro(VISU_OpenGLPointSpriteMapper, "Revision$");
 vtkStandardNewMacro(VISU_OpenGLPointSpriteMapper);
@@ -136,24 +138,24 @@ static PFNGLDELETEBUFFERSARBPROC            vglDeleteBuffersARB           = NULL
 
 bool InitializeARB()
 {
-  void* OpenGLLibrary = dlopen( "libGL.so", RTLD_LAZY );
-
-  vglShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)dlsym( OpenGLLibrary, "glShaderSourceARB" );
-  vglCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)dlsym( OpenGLLibrary, "glCreateShaderObjectARB" );
-  vglCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)dlsym( OpenGLLibrary, "glCompileShaderARB" );
-  vglCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)dlsym( OpenGLLibrary, "glCreateProgramObjectARB" );
-  vglAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)dlsym( OpenGLLibrary, "glAttachObjectARB" );
-  vglLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)dlsym( OpenGLLibrary, "glLinkProgramARB" );
-  vglUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)dlsym( OpenGLLibrary, "glUseProgramObjectARB" );
-  vglGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)dlsym( OpenGLLibrary, "glGetObjectParameterivARB" );
-  vglGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)dlsym( OpenGLLibrary, "glGetInfoLogARB" );
-  vglGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)dlsym( OpenGLLibrary, "glGetAttribLocationARB" );
-  vglVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)dlsym( OpenGLLibrary, "glVertexAttrib1fARB" );
-
-  vglGenBuffersARB = (PFNGLGENBUFFERSARBPROC)dlsym( OpenGLLibrary, "glGenBuffersARB" );
-  vglBindBufferARB = (PFNGLBINDBUFFERARBPROC)dlsym( OpenGLLibrary, "glBindBufferARB" );
-  vglBufferDataARB = (PFNGLBUFFERDATAARBPROC)dlsym( OpenGLLibrary, "glBufferDataARB" );
-  vglDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)dlsym( OpenGLLibrary, "glDeleteBuffersARB" );
+  //void* OpenGLLibrary = dlopen( "libGL.so", RTLD_LAZY );
+
+  vglShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glXGetProcAddressARB( (const GLubyte*)"glShaderSourceARB" );
+  vglCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glXGetProcAddressARB( (const GLubyte*)"glCreateShaderObjectARB" );
+  vglCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glXGetProcAddressARB( (const GLubyte*)"glCompileShaderARB" );
+  vglCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glXGetProcAddressARB( (const GLubyte*)"glCreateProgramObjectARB" );
+  vglAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glXGetProcAddressARB( (const GLubyte*)"glAttachObjectARB" );
+  vglLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glXGetProcAddressARB( (const GLubyte*)"glLinkProgramARB" );
+  vglUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glXGetProcAddressARB( (const GLubyte*)"glUseProgramObjectARB" );
+  vglGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glXGetProcAddressARB( (const GLubyte*)"glGetObjectParameterivARB" );
+  vglGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glXGetProcAddressARB( (const GLubyte*)"glGetInfoLogARB" );
+  vglGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glXGetProcAddressARB( (const GLubyte*)"glGetAttribLocationARB" );
+  vglVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glXGetProcAddressARB( (const GLubyte*)"glVertexAttrib1fARB" );
+
+  vglGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glXGetProcAddressARB( (const GLubyte*)"glGenBuffersARB" );
+  vglBindBufferARB = (PFNGLBINDBUFFERARBPROC)glXGetProcAddressARB( (const GLubyte*)"glBindBufferARB" );
+  vglBufferDataARB = (PFNGLBUFFERDATAARBPROC)glXGetProcAddressARB( (const GLubyte*)"glBufferDataARB" );
+  vglDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glXGetProcAddressARB( (const GLubyte*)"glDeleteBuffersARB" );
 
   if( vglShaderSourceARB && 
       vglCreateShaderObjectARB &&