#include <cmath>
#include <string>
+#include <GL/glx.h>
+
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkCxxRevisionMacro(VISU_OpenGLPointSpriteMapper, "Revision$");
vtkStandardNewMacro(VISU_OpenGLPointSpriteMapper);
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 &&