mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Added imguiLabel() overload.
This commit is contained in:
parent
0c7dea6cb3
commit
fcc642483f
2 changed files with 12 additions and 3 deletions
|
@ -1392,7 +1392,7 @@ struct Imgui
|
|||
return res;
|
||||
}
|
||||
|
||||
void labelVargs(const char* _format, va_list _argList)
|
||||
void labelVargs(const char* _format, va_list _argList, bool _enabled)
|
||||
{
|
||||
char temp[8192];
|
||||
char* out = temp;
|
||||
|
@ -1411,7 +1411,7 @@ struct Imgui
|
|||
, yy + BUTTON_HEIGHT / 2 + TEXT_HEIGHT / 2
|
||||
, ImguiTextAlign::Left
|
||||
, out
|
||||
, imguiRGBA(255, 255, 255, 255)
|
||||
, _enabled?imguiRGBA(255, 255, 255, 255):imguiRGBA(255, 255, 255, 128)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -2499,7 +2499,15 @@ void imguiLabel(const char* _format, ...)
|
|||
{
|
||||
va_list argList;
|
||||
va_start(argList, _format);
|
||||
s_imgui.labelVargs(_format, argList);
|
||||
s_imgui.labelVargs(_format, argList, true);
|
||||
va_end(argList);
|
||||
}
|
||||
|
||||
void imguiLabel(bool _enabled, const char* _format, ...)
|
||||
{
|
||||
va_list argList;
|
||||
va_start(argList, _format);
|
||||
s_imgui.labelVargs(_format, argList, _enabled);
|
||||
va_end(argList);
|
||||
}
|
||||
|
||||
|
|
|
@ -103,6 +103,7 @@ bool imguiItem(const char* _text, bool _enabled = true);
|
|||
bool imguiCheck(const char* _text, bool _checked, bool _enabled = true);
|
||||
bool imguiCollapse(const char* _text, const char* _subtext, bool _checked, bool _enabled = true);
|
||||
void imguiLabel(const char* _format, ...);
|
||||
void imguiLabel(bool _enabled, const char* _format, ...);
|
||||
void imguiValue(const char* _text);
|
||||
bool imguiSlider(const char* _text, float& _val, float _vmin, float _vmax, float _vinc, bool _enabled = true);
|
||||
bool imguiSlider(const char* _text, int32_t& _val, int32_t _vmin, int32_t _vmax, bool _enabled = true);
|
||||
|
|
Loading…
Reference in a new issue