Commit 45e89396 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell

Added a hack to override OpenGL overrides with GL2

This adds VTK_REPLACE_OPENGL_OVERRIDES (off by default) as a build
option, if enabled the vtkRenderingOpenGL module will be modified to
depend on vtkRenderingOpenGL2 (privately) and its overrides modified
so that we can replace existing implementations piece by piece while
running the full suite of regression tests (and seeing how close the
drop in replacement classes are).

Change-Id: I6decb741bde86270c43578e1b24dca4058de6781
parent b7754d7a
......@@ -268,6 +268,15 @@ SET(VTK_HAS_EXODUS 1)
# Provide a few configuration options.
OPTION(BUILD_EXAMPLES "Build VTK examples." OFF)
#-----------------------------------------------------------------------------
# A crazy hack that makes the vtkRenderingOpenGL module depend on the new
# vtkRenderingOpenGL2 module and then changes the overrides for things we
# have very experimental replacements for (that will get less experimental
# over time). This is likely to break many things right now, and less soon...
option(VTK_REPLACE_OPENGL_OVERRIDES
"Replace OpenGL overrides with experimental OpenGL2 overrides (experimental"
OFF)
#-----------------------------------------------------------------------------
# Configure files with settings for use by the build.
......
......@@ -301,6 +301,13 @@ set(opengl_overrides
list(APPEND vtk_module_overrides "vtkPolyDataMapper")
set(vtk_module_vtkPolyDataMapper_override "vtkPainterPolyDataMapper")
# A crazy hack, Ken encouraged me to write, where we override the overrides
# when the option is set to see what the new OpenGL2 code does in all regression
# tests. Right now there is just one (the poly data mapper) with more to follow.
if(VTK_REPLACE_OPENGL_OVERRIDES)
set(vtk_module_vtkPolyDataMapper_override "vtkVBOPolyDataMapper")
endif()
# FIXME: Not sure that this is the best way to handle X...
if(VTK_USE_X)
find_package(X11 REQUIRED)
......
# A hack to let us inject OpenGL2 as a dependency, and change overrides.
unset(_injectOpenGL2)
if(VTK_REPLACE_OPENGL_OVERRIDES)
set(_injectOpenGL2 vtkRenderingOpenGL2)
endif()
vtk_module(vtkRenderingOpenGL
GROUPS
Rendering
......@@ -7,6 +13,7 @@ vtk_module(vtkRenderingOpenGL
# These are likely to be removed soon - split Rendering/OpenGL further.
vtkImagingHybrid # For vtkSampleFunction
vtksys
${_injectOpenGL2}
COMPILE_DEPENDS
vtkParseOGLExt
vtkUtilitiesEncodeString
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment