diff --git a/CMake/vtkOpenGLOptions.cmake b/CMake/vtkOpenGLOptions.cmake index f419e08b4db96f6584ed25e4558e7eb1fbd30f85..a4b514b1e7f48ecae250ac4b660c22930a7d6174 100644 --- a/CMake/vtkOpenGLOptions.cmake +++ b/CMake/vtkOpenGLOptions.cmake @@ -24,12 +24,12 @@ cmake_dependent_option(VTK_USE_WIN32_OPENGL "Use Win32 APIs for VTK render windo mark_as_advanced(VTK_USE_WIN32_OPENGL) set(default_use_sdl2 OFF) -if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") - set(default_use_sdl2 ON) -endif() # VTK_DEPRECATED_IN_9_4_0() Remove option when vtkSDL2OpenGLRenderWindow and vtkSDL2WebGPURenderWindow are removed. -option(VTK_USE_SDL2 "Add SDL2 classes to VTK" "${default_use_sdl2}") +option(VTK_USE_SDL2 "Add SDL2 classes to VTK. This option will soon be removed" "${default_use_sdl2}") mark_as_advanced(VTK_USE_SDL2) +if (VTK_USE_SDL2) + message(WARNING "You are using a soon to be deprecated flag. The VTK_USE_SDL2 option is marked for deprecation in VTK 9.4!") +endif () # For optional APIs that could be available for the OpenGL implementation # being used, we define VTK_OPENGL_HAS_<feature> options. These are not to be diff --git a/Documentation/docs/build_instructions/build_settings.md b/Documentation/docs/build_instructions/build_settings.md index 905520ce521f6a827d3b98e47d11c866b1ce8b74..63bc281b9f7c4c404bcfdafd6f107804be828784 100644 --- a/Documentation/docs/build_instructions/build_settings.md +++ b/Documentation/docs/build_instructions/build_settings.md @@ -55,8 +55,7 @@ exist to make sure a broken build is not being made. Essentially: render windows. * `VTK_USE_X` (default `ON` for Unix-like platforms except macOS, iOS, and Emscripten, `OFF` otherwise): Use X for render windows. - * `VTK_USE_SDL2` (default `ON` for Emscripten, `OFF` otherwise): Use - SDL2 for render windows. + * `VTK_USE_SDL2` (default `OFF`): Use SDL2 for render windows. * `VTK_OPENGL_HAS_OSMESA` (default `OFF`): Use to indicate that the OpenGL library being used supports offscreen Mesa rendering (OSMesa). diff --git a/Documentation/release/dev/disable-sdl2-by-default.md b/Documentation/release/dev/disable-sdl2-by-default.md new file mode 100644 index 0000000000000000000000000000000000000000..c54df090754e99a1f3cea62e1c6468a549693042 --- /dev/null +++ b/Documentation/release/dev/disable-sdl2-by-default.md @@ -0,0 +1,13 @@ +## SDL2 usage is now disabled by default + +VTK has now deprecated the use of SDL2 in the render window and interactor classes. The cmake option `VTK_USE_SDL2` will soon be removed. +If your application relies on object factory mechanism (most common usage), there is nothing you need to do besides removing `VTK_USE_SDL2` +from your build settings. + +Otherwise, VTK recommends using these new webassembly classes instead. + +|New class| Old class| +| :----------------: | :------: | +| `vtkWebAssemblyOpenGLRenderWindow`|`vtkSDL2OpenGLRenderWindow`| +| `vtkWebAssemblyWebGPURenderWindow`|`vtkSDL2WebGPURenderWindow`| +| `vtkWebAssemblyRenderWindowInteractor`|`vtkSDL2RenderWindowInteractor`|