diff --git a/base/VulkanUIOverlay.cpp b/base/VulkanUIOverlay.cpp index edc2c77c..19310638 100644 --- a/base/VulkanUIOverlay.cpp +++ b/base/VulkanUIOverlay.cpp @@ -1,3 +1,4 @@ +#include "VulkanUIOverlay.h" /* * UI overlay class using ImGui * @@ -563,6 +564,14 @@ namespace vks return ImGui::Checkbox(caption, value); } + bool UIOverlay::checkBox(const char *caption, int32_t *value) + { + bool val = (*value == 1); + bool res = ImGui::Checkbox(caption, &val); + *value = val; + return res; + } + bool UIOverlay::inputFloat(const char *caption, float *value, float step, uint32_t precision) { return ImGui::InputFloat(caption, value, step, step * 10.0f, precision); @@ -574,6 +583,11 @@ namespace vks return false; } + bool UIOverlay::sliderInt(const char* caption, int32_t* value, int32_t min, int32_t max) + { + return ImGui::SliderInt(caption, value, min, max); + } + bool UIOverlay::comboBox(const char *caption, int32_t *itemindex, std::vector items) { if (items.empty()) { @@ -587,6 +601,11 @@ namespace vks return ImGui::Combo(caption, itemindex, &charitems[0], static_cast(charitems.size()), 4); } + bool UIOverlay::button(const char *caption) + { + return ImGui::Button(caption); + } + void UIOverlay::text(const char *formatstr, ...) { va_list args; diff --git a/base/VulkanUIOverlay.h b/base/VulkanUIOverlay.h index c5be108b..c32b656f 100644 --- a/base/VulkanUIOverlay.h +++ b/base/VulkanUIOverlay.h @@ -89,9 +89,12 @@ namespace vks bool header(const char* caption); bool checkBox(const char* caption, bool* value); + bool checkBox(const char* caption, int32_t* value); bool inputFloat(const char* caption, float* value, float step, uint32_t precision); bool sliderFloat(const char* caption, float* value, float min, float max); + bool sliderInt(const char* caption, int32_t* value, int32_t min, int32_t max); bool comboBox(const char* caption, int32_t* itemindex, std::vector items); - void text(const char* formatstr, ...); + bool button(const char* caption); + void text(const char* formatstr, ...); }; } \ No newline at end of file