From: ouv Date: Mon, 26 Jun 2006 13:56:01 +0000 (+0000) Subject: Checking for symbols loaded from OpenGL library X-Git-Tag: T3_2_1_pre~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f5af1ba71d87fa18813a1cda3f1bd8c27d4f12f;p=modules%2Fvisu.git Checking for symbols loaded from OpenGL library --- diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index f0078022..481c755f 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -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 ) {