]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Checking for symbols loaded from OpenGL library
authorouv <ouv@opencascade.com>
Mon, 26 Jun 2006 13:56:01 +0000 (13:56 +0000)
committerouv <ouv@opencascade.com>
Mon, 26 Jun 2006 13:56:01 +0000 (13:56 +0000)
src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx

index f0078022baf30303a7847e6d682c41574299123c..481c755f168e76bc97ef2d97e732aac8f3e2ef86 100755 (executable)
@@ -134,7 +134,7 @@ static PFNGLBINDBUFFERARBPROC               vglBindBufferARB              = NULL
 static PFNGLBUFFERDATAARBPROC               vglBufferDataARB              = NULL;
 static PFNGLDELETEBUFFERSARBPROC            vglDeleteBuffersARB           = NULL;
 
-int InitializeARB()
+bool InitializeARB()
 {
   void* OpenGLLibrary = dlopen( "libGL.so", RTLD_LAZY );
 
@@ -155,10 +155,27 @@ int InitializeARB()
   vglBufferDataARB = (PFNGLBUFFERDATAARBPROC)dlsym( OpenGLLibrary, "glBufferDataARB" );
   vglDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)dlsym( OpenGLLibrary, "glDeleteBuffersARB" );
 
-  return 1;
+  if( vglShaderSourceARB && 
+      vglCreateShaderObjectARB &&
+      vglCompileShaderARB &&
+      vglCreateProgramObjectARB &&
+      vglAttachObjectARB &&
+      vglLinkProgramARB &&
+      vglUseProgramObjectARB &&
+      vglGetObjectParameterivARB &&
+      vglGetInfoLogARB &&
+      vglGetAttribLocationARB &&
+      vglVertexAttrib1fARB &&
+      vglGenBuffersARB &&
+      vglBindBufferARB &&
+      vglBufferDataARB &&
+      vglDeleteBuffersARB )
+    return true;
+
+  return false;
 };
 
-static int IsARBInitialized = InitializeARB();
+static bool IsARBInitialized = InitializeARB();
 static float Tolerance = 1.0 / VTK_LARGE_FLOAT;
 
 //-----------------------------------------------------------------------------
@@ -385,7 +402,8 @@ bool VISU_OpenGLPointSpriteMapper::InitExtensions()
   char* ext = (char*)glGetString( GL_EXTENSIONS );
   //cout << "OpenGL extensions : " << ext << endl;
 
-  if( strstr( ext, "GL_ARB_point_sprite" ) == NULL ||
+  if( !IsARBInitialized ||
+      strstr( ext, "GL_ARB_point_sprite" ) == NULL ||
       strstr( ext, "GL_ARB_shader_objects" ) == NULL ||
       strstr( ext, "GL_ARB_vertex_buffer_object" ) == NULL )
   {