diff --git a/Source/Rendering/CMakeLists.txt b/Source/Rendering/CMakeLists.txt index 81409e993098af01edce7ba00bb5b81794c66a3f..522c4eb491360adf639e746e087cb5735caea479 100644 --- a/Source/Rendering/CMakeLists.txt +++ b/Source/Rendering/CMakeLists.txt @@ -95,7 +95,7 @@ if( NOT iMSTK_USE_Vulkan ) VTKRenderer VTKRenderer/RenderDelegate) set(RENDERING_DEPENDENCIES - GUIOverlay + #GUIOverlay Materials) else() set(RENDERING_H_FILES ${VULKAN_H_FILES}) diff --git a/Source/Rendering/GUIOverlay/CMakeLists.txt b/Source/Rendering/GUIOverlay/CMakeLists.txt index cf9c262de3e6da12b7982a387d29973909d1fafa..7c5636e15a60bf1fb11427a7ce1712894267c477 100644 --- a/Source/Rendering/GUIOverlay/CMakeLists.txt +++ b/Source/Rendering/GUIOverlay/CMakeLists.txt @@ -1,6 +1,9 @@ #----------------------------------------------------------------------------- # Create target #----------------------------------------------------------------------------- +if( NOT iMSTK_USE_Vulkan ) + +else() include(imstkAddLibrary) file (GLOB_RECURSE GUI_h_files "${CMAKE_CURRENT_SOURCE_DIR}/imstk*.h") @@ -36,6 +39,7 @@ imstk_add_library( GUIOverlay imgui ${Vulkan_Dependency} ) +endif() #----------------------------------------------------------------------------- # Testing diff --git a/Source/SimulationManager/imstkViewer.cpp b/Source/SimulationManager/imstkViewer.cpp index 50c68d38bec6256b234dc6917994549098885264..22c36b01d862a9a807f2be2c205a3e24ec88b260 100644 --- a/Source/SimulationManager/imstkViewer.cpp +++ b/Source/SimulationManager/imstkViewer.cpp @@ -23,13 +23,20 @@ #include "imstkScene.h" #include "imstkCollisionGraph.h" #include "imstkCamera.h" +#include "imstkLogger.h" #include "imstkScreenCaptureUtility.h" + +#ifdef iMSTK_USE_Vulkan #include "imstkGUICanvas.h" +#endif namespace imstk { -Viewer::Viewer() : m_canvas(std::make_shared<GUIOverlay::Canvas>()) +Viewer::Viewer() { +#ifdef iMSTK_USE_Vulkan + m_canvas(std::make_shared<GUIOverlay::Canvas>()) +#endif } const std::shared_ptr<Scene>& @@ -58,12 +65,15 @@ Viewer::getScreenCaptureUtility() const return m_screenCapturer; } +#ifdef iMSTK_USE_Vulkan const std::shared_ptr<GUIOverlay::Canvas>& Viewer::getCanvas() { return m_canvas; } +#endif + void Viewer::setOnCharFunction(char c, EventHandlerFunction func) { diff --git a/Source/SimulationManager/imstkViewer.h b/Source/SimulationManager/imstkViewer.h index 9b2dc052218370e2fac952a0b1b7e0d07b8aa618..8b575340c72d8238fab2bc9215188d2192c72c07 100644 --- a/Source/SimulationManager/imstkViewer.h +++ b/Source/SimulationManager/imstkViewer.h @@ -29,10 +29,13 @@ namespace imstk class SimulationManager; class Scene; class ScreenCaptureUtility; + +#ifdef iMSTK_USE_Vulkan namespace GUIOverlay { class Canvas; } +#endif /// /// \class Viewer /// @@ -103,10 +106,12 @@ public: /// virtual void setBackgroundColors(const Vec3d color1, const Vec3d color2 = Vec3d::Zero(), const bool gradientBackground = false) = 0; +#ifdef iMSTK_USE_Vulkan /// /// \brief Get canvas /// const std::shared_ptr<GUIOverlay::Canvas>& getCanvas(); +#endif /// /// \brief Set custom event handlers on interactor style @@ -136,6 +141,8 @@ protected: std::shared_ptr<ScreenCaptureUtility> m_screenCapturer; ///> Screen shot utility bool m_running = false; +#ifdef iMSTK_USE_Vulkan std::shared_ptr<GUIOverlay::Canvas> m_canvas = nullptr; +#endif }; }