Added imguiChoose function.

This commit is contained in:
bkaradzic 2014-01-18 20:07:00 -08:00
parent 924cb614c2
commit 804bd01b01
2 changed files with 17 additions and 0 deletions

View File

@ -1513,6 +1513,20 @@ bool imguiSlider(const char* _text, int32_t* _val, int32_t _vmin, int32_t _vmax,
return result; return result;
} }
uint32_t imguiChooseUseMacroInstead(uint32_t _selected, const char* _first, ...)
{
uint32_t ii = 0;
for (const char** str = &_first; *str != NULL; ++str, ++ii)
{
if (imguiCheck(*str, ii == _selected) )
{
_selected = ii;
}
}
return _selected;
}
void imguiDrawText(int32_t _x, int32_t _y, ImguiTextAlign::Enum _align, const char* _text, uint32_t _argb) void imguiDrawText(int32_t _x, int32_t _y, ImguiTextAlign::Enum _align, const char* _text, uint32_t _argb)
{ {
s_imgui.drawText(_x, _y, _align, _text, _argb); s_imgui.drawText(_x, _y, _align, _text, _argb);

View File

@ -72,6 +72,9 @@ 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, 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); bool imguiSlider(const char* _text, int32_t* _val, int32_t _vmin, int32_t _vmax, bool _enabled = true);
uint32_t imguiChooseUseMacroInstead(uint32_t _selected, const char* _first, ...);
#define imguiChoose(...) imguiChooseUseMacroInstead(__VA_ARGS__, NULL)
void imguiDrawText(int _x, int _y, ImguiTextAlign::Enum _align, const char* _text, uint32_t _argb); void imguiDrawText(int _x, int _y, ImguiTextAlign::Enum _align, const char* _text, uint32_t _argb);
void imguiDrawLine(float _x0, float _y0, float _x1, float _y1, float _r, uint32_t _argb); void imguiDrawLine(float _x0, float _y0, float _x1, float _y1, float _r, uint32_t _argb);
void imguiDrawRoundedRect(float _x, float _y, float _w, float _h, float _r, uint32_t _argb); void imguiDrawRoundedRect(float _x, float _y, float _w, float _h, float _r, uint32_t _argb);