From 81eebce92d19948bfcf2ecceaa262ae81283461f Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 6 Sep 2005 07:04:53 +0000 Subject: [PATCH] some ifdef's added for compatibility --- src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index 73868c2c..81504175 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -79,6 +79,7 @@ PFNGLBINDPROGRAMARBPROC glBindProgramARB = NULL; PFNGLPROGRAMSTRINGARBPROC glProgramStringARB = NULL; PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB = NULL; +#ifdef GL_ARB_shader_objects PFNGLSHADERSOURCEARBPROC glShaderSourceARB = NULL; PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB = NULL; PFNGLCOMPILESHADERARBPROC glCompileShaderARB = NULL; @@ -88,6 +89,7 @@ PFNGLLINKPROGRAMPROC glLinkProgramARB = NULL; PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB = NULL; PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB = NULL; PFNGLGETINFOLOGARBPROC glGetInfoLogARB = NULL; +#endif unsigned int shaderId; @@ -231,6 +233,7 @@ void initShader() //glBindProgramARB( GL_VERTEX_PROGRAM_ARB, shaderId ); //glProgramStringARB( GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen( shader ), shader ); +#ifdef GL_ARB_shader_objects GLhandleARB v = glCreateShaderObjectARB( GL_VERTEX_SHADER_ARB ); glShaderSourceARB( v, 1, (const GLcharARB**)&shader, NULL ); glCompileShaderARB( v ); @@ -243,6 +246,8 @@ void initShader() //printInfoLog( p ); glUseProgramObjectARB( p ); +#endif + /* cout << "Shader from " << fileName << endl; for( int i = 0; i < strlen( shader ); i++ ) @@ -315,6 +320,7 @@ void VISU_OpenGLPointSpriteMapper::InitializeExtensions() glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)dlsym( libHandle, "glProgramStringARB" ); glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)dlsym( libHandle, "glProgramEnvParameter4fARB" ); +#ifdef GL_ARB_shader_objects glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)dlsym( libHandle, "glShaderSourceARB" ); glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)dlsym( libHandle, "glCreateShaderObjectARB" ); glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)dlsym( libHandle, "glCompileShaderARB" ); @@ -324,6 +330,7 @@ void VISU_OpenGLPointSpriteMapper::InitializeExtensions() glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)dlsym( libHandle, "glUseProgramObjectARB" ); glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)dlsym( libHandle, "glGetObjectParameterivARB" ); glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)dlsym( libHandle, "glGetInfoLogARB" ); +#endif initShader(); setShaderConstants(); -- 2.39.2