[vtkusers] VTK 8.1.0 opengl 2 init.... how do I do this now?

Ken Martin ken.martin at kitware.com
Fri Apr 6 08:42:56 EDT 2018


Supposedly you shouldn't need to do any of that and CMake will take care of
it all assuming you link against the right targets (which generally works
for me for my projects).  In one case where that did not seem to work on an
iOS app I added

  vtkRenderingOpenGL2ObjectFactory *of =
vtkRenderingOpenGL2ObjectFactory::New();
  vtkObjectFactory::RegisterFactory(of);

to my source code to pull in and initialize the object factory I needed.


On Thu, Apr 5, 2018 at 7:54 PM, Brian Davis <bitminer at gmail.com> wrote:

> maybe:
>
> //VTK_MODULE_INIT(vtkRenderingOpenGL);
> VTK_MODULE_INIT(vtkRenderingOpenGL2);
> VTK_MODULE_INIT(vtkInteractionStyle);
> //VTK_MODULE_INIT(vtkRenderingVolumeOpenGL);
> //VTK_MODULE_INIT(vtkGPUVolumeRayCastMapper);
> //VTK_MODULE_INIT(vtkFixedPointVolumeRayCastMapper);
>
>
> and
>
> target_compile_definitions(
>     vtk_volume_renderer
>     PRIVATE
>     volume_render_EXPORTS=yes
>     vtkRenderingCore_AUTOINIT="1(vtkRenderingOpenGL)"
>     vtkRenderingVolume_AUTOINIT=1(vtkRenderingVolumeOpenGL)
>     vtkRenderingCore=vtkRenderingOpenGL
> )
>
> at least it compiles.with warning
>
> ...
> 2>C:/projects/4DDSA/brian/build/CMakeFiles/vtkRenderingCore_AUTOINIT_
> vtkInteractionStyle_vtkRenderingFreeType_vtkRenderingOpenGL2.h(1):
> warning C4005: 'vtkRenderingCore_AUTOINIT' : macro redefinition
> 2>          command-line arguments :  see previous definition of
> 'vtkRenderingCore_AUTOINIT'
> ...
> ========== Build: 2 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========
>
>
>
>
> On Thu, Apr 5, 2018 at 6:38 PM, Brian Davis <bitminer at gmail.com> wrote:
>
>> Part of solution may be to change:
>>
>> VTK_MODULE_INIT(vtkRenderingOpenGL);
>>
>> to
>>
>> VTK_MODULE_INIT(vtkRenderingOpenGL2);
>>
>>
>>
>> On Thu, Apr 5, 2018 at 6:30 PM, Brian Davis <bitminer at gmail.com> wrote:
>>
>>> I use to:
>>>
>>> #include <vtkAutoInit.h>
>>> VTK_MODULE_INIT(vtkRenderingOpenGL);
>>> VTK_MODULE_INIT(vtkInteractionStyle);
>>> VTK_MODULE_INIT(vtkRenderingVolumeOpenGL);
>>> //VTK_MODULE_INIT(vtkGPUVolumeRayCastMapper);
>>> //VTK_MODULE_INIT(vtkFixedPointVolumeRayCastMapper);
>>>
>>>
>>> and at times define
>>>
>>> vtkRenderingCore_AUTOINIT="1(vtkRenderingOpenGL)"
>>> vtkRenderingVolume_AUTOINIT=1(vtkRenderingVolumeOpenGL)
>>> vtkRenderingCore=vtkRenderingOpenGL
>>>
>>> However in 8.1.0 build I get
>>>
>>> (void)" (?vtkRenderingOpenGL_AutoInit_Construct@@YAXXZ) referenced in
>>> function "public: __cdecl vtkRenderingOpenGL_ModuleInit:
>>> :vtkRenderingOpenGL_ModuleInit(void)" (??0vtkRenderingOpenGL_ModuleInit@
>>> @QEAA at XZ)
>>>
>>> which reminds me of every other time I try and build it when the version
>>> changes.  What is special sauce recipe for 8.1.0 and building with post
>>> opengl 2 (GLSL shader enabled version)
>>>
>>>
>>> Anyone count the number of threads over the years that discuss the
>>> opengl init in VTK... there is such a sea of posts I am not even going to
>>> bother to fish out what may be the solution somewhere buried in the ether
>>> else I have to get out my heavy duty digital backhoe and realy dig for it.
>>> Sure I'll find it in some blog post somewhere.
>>>
>>> Any one at Kitware want to rethink the opengl design (Build and init
>>> process)?
>>>
>>>
>>> my superbuild of vtk defines:
>>>
>>>         VTK_BUILD_DEFINITIONS
>>>             -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}
>>>                -DINSTALL_PREFIX=${INSTALL_PREFIX}
>>> #            -DModule_vtkRenderingVolumeOpenGL=ON
>>> #            -DModule_vtkRenderingVolumeOpenGLNew=ON
>>>             -DModule_vtkTestingCore:BOOL=ON
>>>             -DModule_vtkTestingRendering=ON
>>>             -DModule_vtkRenderingVolumeOpenGL2=ON
>>>
>>>             -DVTK_RENDERING_BACKEND=OpenGL2
>>>             -DBUILD_EXAMPLES=${VTK_BUILD_EXAMPLES}
>>>             -DBUILD_TESTING=${VTK_BUILD_TESTING}
>>>
>>>
>>>
>>> ExternalProject_Add(
>>>  ${VTK_VERSION_NAME}
>>> ...
>>> CMAKE_ARGS ${VTK_BUILD_DEFINITIONS}
>>> ...
>>> )
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Brian J. Davis
>>
>
>
>
> --
> Brian J. Davis
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180406/417465d5/attachment.html>


More information about the vtkusers mailing list