[vtkusers] correct way of using VTK_MODULE_INIT with opengl2

Marcus D. Hanwell marcus.hanwell at kitware.com
Thu Aug 14 11:09:36 EDT 2014


On Thu, Aug 7, 2014 at 2:06 AM, Ahmet Doğan <isimtic at gmail.com> wrote:
> hi,
>
> I have swith to opengl2 for performance purposes. But when I was using
> opengl just I init rendering modules like
>
> #define vtkRenderingCore_AUTOINIT
> 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)
> #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL)
>
> but after compiling vtk with opengl2 support some of them not using anymore
> than I tried to use with "autoint.h" like
>
> #include <vtkAutoInit.h>
> VTK_MODULE_INIT(vtkRenderingOpenGL2)
>
> after that I get warning : vtkInteractorStyleSwitchBase (00000000026CCE00):
> Warning: Link to vtkInteractionStyle for default style selection.Thus, what
> is the correct initialization for vtkRenderingCore and vtkRenderingVolume
> with opengl2 backend.
>
This is because vtkRenderingOpenGL2 replaces vtkRenderingOpenGL, but
you will still need vtkInteractionStyle. I would encourage using the
module init macros where possible as they are easier to understand, it
then becomes an entry per implementation module in the file with the
initialization code in it.

Hope that helps.

Marcus


More information about the vtkusers mailing list