Additional UI overlay widget creation functions
This commit is contained in:
parent
0907e3c680
commit
3b11701eb2
2 changed files with 23 additions and 1 deletions
|
|
@ -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<std::string> items)
|
||||
{
|
||||
if (items.empty()) {
|
||||
|
|
@ -587,6 +601,11 @@ namespace vks
|
|||
return ImGui::Combo(caption, itemindex, &charitems[0], static_cast<uint32_t>(charitems.size()), 4);
|
||||
}
|
||||
|
||||
bool UIOverlay::button(const char *caption)
|
||||
{
|
||||
return ImGui::Button(caption);
|
||||
}
|
||||
|
||||
void UIOverlay::text(const char *formatstr, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue