static PFNGLBUFFERDATAARBPROC vglBufferDataARB = NULL;
static PFNGLDELETEBUFFERSARBPROC vglDeleteBuffersARB = NULL;
-int InitializeARB()
+bool InitializeARB()
{
void* OpenGLLibrary = dlopen( "libGL.so", RTLD_LAZY );
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;
//-----------------------------------------------------------------------------
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 )
{