[vtkusers] VTK static library problem

Simon ESNEAULT simon.esneault at gmail.com
Thu Feb 24 12:35:35 EST 2011


Hi,

We we're facing the same problem here with the vtkVolumeTextureMapper3D not
working in windows static with VTK 5.6.1 and crashing in PixellBuffer
with vtkgl::GenBuffer going NULL.
The exact same program works just fine with vtk 5.4, or with 5.6.1 on LINUX
and MacOSX.

After some research, it appears that it was an openGl extension loading
error. For some reason some extensions were not loaded at (or deloaded !?)
at runtime. So we added something like that at the beginning of the project
:

                // Explicitly load openGl Extensions
vtkOpenGLExtensionManager *l_extensions = vtkOpenGLExtensionManager::New();
 l_extensions->SetRenderWindow( this->GetRenderWindow() );

// OpenGl
 if( l_extensions->ExtensionSupported("GL_VERSION_1_2") )
l_extensions->LoadExtension("GL_VERSION_1_2");

if( l_extensions->ExtensionSupported("GL_VERSION_1_3") )
l_extensions->LoadExtension("GL_VERSION_1_3");

if( l_extensions->ExtensionSupported("GL_VERSION_1_4") )
l_extensions->LoadExtension("GL_VERSION_1_4");
 if( l_extensions->ExtensionSupported("GL_VERSION_1_5") )
 l_extensions->LoadExtension("GL_VERSION_1_5");
 if( l_extensions->ExtensionSupported("GL_VERSION_2_0") )
 l_extensions->LoadExtension("GL_VERSION_2_0");
 if( l_extensions->ExtensionSupported("GL_VERSION_2_1") )
 l_extensions->LoadExtension("GL_VERSION_2_1");
 if( l_extensions->ExtensionSupported("GL_VERSION_3_0") )
 l_extensions->LoadExtension("GL_VERSION_3_0");


if( l_extensions->ExtensionSupported("GL_ARB_color_buffer_float") )
 l_extensions->LoadExtension("GL_ARB_color_buffer_float");

if( l_extensions->ExtensionSupported("GL_ARB_depth_texture") )
 l_extensions->LoadExtension("GL_ARB_depth_texture");
 if( l_extensions->ExtensionSupported("GL_ARB_fragment_program") )
 l_extensions->LoadExtension("GL_ARB_fragment_program");

if( l_extensions->ExtensionSupported("GL_ARB_fragment_shader") )
 l_extensions->LoadExtension("GL_ARB_fragment_shader");

if( l_extensions->ExtensionSupported("GL_ARB_imaging") )
 l_extensions->LoadExtension("GL_ARB_imaging");

if( l_extensions->ExtensionSupported("GL_ARB_multitexture") )
 l_extensions->LoadExtension("GL_ARB_multitexture");

if( l_extensions->ExtensionSupported("GL_ARB_shader_objects") )
 l_extensions->LoadExtension("GL_ARB_shader_objects");

if( l_extensions->ExtensionSupported("GL_ARB_texture_compression") )
 l_extensions->LoadExtension("GL_ARB_texture_compression");

if( l_extensions->ExtensionSupported("GL_ARB_texture_float") )
 l_extensions->LoadExtension("GL_ARB_texture_float");

if( l_extensions->ExtensionSupported("GL_ARB_texture_rectangle") )
 l_extensions->LoadExtension("GL_ARB_texture_rectangle");

if( l_extensions->ExtensionSupported("GL_ARB_texture_non_power_of_two") )
 l_extensions->LoadExtension("GL_ARB_texture_non_power_of_two");

 if( l_extensions->ExtensionSupported("GL_ARB_vertex_program") )
l_extensions->LoadExtension("GL_ARB_vertex_program");

 // NVIDIA
if( l_extensions->ExtensionSupported("GL_NV_texture_shader2") )
 l_extensions->LoadExtension("GL_NV_texture_shader2");

if( l_extensions->ExtensionSupported("GL_NV_register_combiners") )
 l_extensions->LoadExtension("GL_NV_register_combiners");
 if( l_extensions->ExtensionSupported("GL_NV_register_combiners2") )
l_extensions->LoadExtension("GL_NV_register_combiners2");

 // ATI
if( l_extensions->ExtensionSupported("GL_ATI_fragment_shader") )
 l_extensions->LoadExtension("GL_ATI_fragment_shader");


if( l_extensions->ExtensionSupported("GL_EXT_framebuffer_object") )
 l_extensions->LoadExtension("GL_EXT_framebuffer_object");

if( l_extensions->ExtensionSupported("GL_EXT_texture3D") )
 l_extensions->LoadExtension("GL_EXT_texture3D");


Which is completly hugly but does work. I think you don't need all of them
but I was too lazy to test which one are vital and which are not

Good luck with that :)

Simon


On Thu, Jul 15, 2010 at 11:56, naresh <naresh at winner.co.in> wrote:

> Hi
>
> I have one dll  that all coding that is using vtk internally and i am using
> vtk as static library. But when i build library and try to run application
> is crash in vtkPixelBufferObject.cxx in CreatBuffer function.  I tried to
> debug and found out
> vtkgl::GenBuffers is NULL so it crash out. I also tried to go more further
> and check the debug of  vtkPixelBufferObject::LoadRequiredExtensions
> function which loads extension vtkgl::GenBuffers but when this function ends
> vtkgl::GenBuffer goes NULL. I donot know why ?
>
> Anyone can tell me what i am doing wrong ?
>
> Is there any issue of over multithread code generation from compiler ?  I
> had checked both MDd flag. Which matches both same.
>
> Alex
>
>
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
------------------------------------------------------------------
Simon Esneault - Therenva
Centre d'Innovation Technologique
Centre Cardio-Pneumologique
CHU Pontchaillou
Rennes, France
Tel : +33 (0)6 64 61 30 94
Mail : simon.esneault at therenva.com
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110224/8289df26/attachment.htm>


More information about the vtkusers mailing list