diff --git a/include/tz/gpu/settings.hpp b/include/tz/gpu/settings.hpp index b5289c71b4..df87a840ef 100644 --- a/include/tz/gpu/settings.hpp +++ b/include/tz/gpu/settings.hpp @@ -3,6 +3,25 @@ namespace tz::gpu { + /** + * @ingroup tz_gpu + * @defgroup tz_gpu_settings Settings + * @brief Global settings that affect all passes and graphs. The kind of stuff you'd expect to see in a game's video options. + */ + + /** + * @ingroup tz_gpu_settings + * @brief Query as to whether vsync is enabled. + * + * By default, vsync is disabled. + */ + bool settings_get_vsync(); + /** + * @ingroup tz_gpu_settings + * @brief Enable/disable vsync. + * + * By default, vsync is disabled. You should assume that this function will take a significantly long time. + */ void settings_set_vsync(bool enabled); } diff --git a/src/tz/gpu/rhi_vulkan.cpp b/src/tz/gpu/rhi_vulkan.cpp index 2342c47a40..c7a944a3e6 100644 --- a/src/tz/gpu/rhi_vulkan.cpp +++ b/src/tz/gpu/rhi_vulkan.cpp @@ -1685,6 +1685,11 @@ namespace tz::gpu current_frame = (current_frame + 1) % frame_overlap; } + bool settings_get_vsync() + { + return settings.vsync_enabled; + } + void settings_set_vsync(bool enabled) { if(settings.vsync_enabled == enabled)