Browse Source

Added imgui getters for widgetX and widgetY.

Dario Manesku 11 years ago
parent
commit
63d7db800c
2 changed files with 13 additions and 0 deletions
  1. 10 0
      examples/common/imgui/imgui.cpp
  2. 3 0
      examples/common/imgui/imgui.h

+ 10 - 0
examples/common/imgui/imgui.cpp

@@ -2594,6 +2594,16 @@ void imguiSeparatorLine(uint16_t _height)
 	s_imgui.separatorLine(_height);
 }
 
+int32_t imguiGetWidgetX()
+{
+	return s_imgui.m_widgetX;
+}
+
+int32_t imguiGetWidgetY()
+{
+	return s_imgui.m_widgetY;
+}
+
 bool imguiButton(const char* _text, bool _enabled, uint32_t _rgb0, int32_t _r)
 {
 	return s_imgui.button(_text, _enabled, _rgb0, _r);

+ 3 - 0
examples/common/imgui/imgui.h

@@ -128,6 +128,9 @@ void imguiUnindent(uint16_t _width = IMGUI_INDENT_VALUE);
 void imguiSeparator(uint16_t _height = IMGUI_SEPARATOR_VALUE);
 void imguiSeparatorLine(uint16_t _height = IMGUI_SEPARATOR_VALUE);
 
+int32_t imguiGetWidgetX();
+int32_t imguiGetWidgetY();
+
 bool imguiButton(const char* _text, bool _enabled = true, uint32_t _rgb0 = IMGUI_BUTTON_RGB0, int32_t _r = IMGUI_BUTTON_R);
 bool imguiItem(const char* _text, bool _enabled = true);
 bool imguiCheck(const char* _text, bool _checked, bool _enabled = true);