From 1f5af1ba71d87fa18813a1cda3f1bd8c27d4f12f Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 26 Jun 2006 13:56:01 +0000 Subject: [PATCH] Checking for symbols loaded from OpenGL library --- src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) 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 ) { -- 2.39.2