diff --git a/lib/graphics_engine/include/ge_vulkan_driver.hpp b/lib/graphics_engine/include/ge_vulkan_driver.hpp index af83f839a..e4cb1a11b 100644 --- a/lib/graphics_engine/include/ge_vulkan_driver.hpp +++ b/lib/graphics_engine/include/ge_vulkan_driver.hpp @@ -320,6 +320,14 @@ namespace GE { return m_pre_rotation_matrix; } virtual void pauseRendering(); virtual void unpauseRendering(); + void updateSwapInterval(int value) + { + if (m_params.SwapInterval == value) + return; + m_params.SwapInterval = value; + destroySwapChainRelated(false/*handle_surface*/); + createSwapChainRelated(false/*handle_surface*/); + } private: struct SwapChainSupportDetails { diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp index 928f97be4..bda8c62a0 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp @@ -20,6 +20,7 @@ #include "COpenGLExtensionHandler.h" #include "guiengine/engine.hpp" +#include "ge_main.hpp" #include "glad/gl.h" #include "ge_vulkan_driver.hpp" #include "MoltenVK.h" @@ -330,6 +331,13 @@ extern "C" void update_swap_interval(int swap_interval) if (swap_interval > 1) swap_interval = 1; + GE::GEVulkanDriver* gevk = GE::getVKDriver(); + if (gevk) + { + gevk->updateSwapInterval(swap_interval); + return; + } + // Try adaptive vsync first if support if (swap_interval > 0) {