[vtk-developers] Detecting OpenGL2 mode at compile time?

Ken Martin ken.martin at kitware.com
Thu Jul 9 09:04:14 EDT 2015


I have been doing something like the following in my CMakeLists files



if(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")

  set_source_files_properties(

    vtkPSurfaceLICComposite.cxx

    PROPERTIES COMPILE_FLAGS -DVTK_OPENGL2)

endif()



Ken Martin PhD

Chairman & CFO

Kitware Inc.

28 Corporate Drive

Clifton Park NY 12065

ken.martin at kitware.com

518 881-4901 (w)

518 371-4573 (f)



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.



*From:* vtk-developers [mailto:vtk-developers-bounces at vtk.org] *On Behalf
Of *Andrew Maclean
*Sent:* Thursday, July 9, 2015 7:39 AM
*To:* VTK Developers; Sean McBride
*Subject:* Re: [vtk-developers] Detecting OpenGL2 mode at compile time?



Hi Sean,
   Off the top of my head, I think VTK_RENDERING_BACKEND is visible and
this has the values OpenGL or OpenGL2.

Regards
   Andrew

>
> ---------- Forwarded message ----------
> From: Sean McBride <sean at rogue-research.com>
> To: <vtk-developers at vtk.org>
> Cc:
> Date: Wed, 8 Jul 2015 18:46:33 -0400
> Subject: [vtk-developers] Detecting OpenGL2 mode at compile time?
> Hi all,
>
> Is there a way to detect at compile-time OpenGL vs OpenGL2 mode?
>
> Since my app uses Xcode, I have to do the factory initialization thing,
and I'd like to be able to handle both cases as I test between both
OpenGLs, ie:
>
> #if ???
>  #define vtkRenderingCore_AUTOINIT
3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL)
> #elif ???
>  #define vtkRenderingCore_AUTOINIT
3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL2)
> #endif
>
> I don't see anything in vtkConfigure.h.
>
> Thanks,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150709/affda8fb/attachment.html>


More information about the vtk-developers mailing list