Browse Source

New imgui version, fix for Travis Mac workers.

Thomas Buck 9 years ago
parent
commit
589649cb51
6 changed files with 820 additions and 405 deletions
  1. 1
    0
      ChangeLog.md
  2. 1
    1
      cmake/travis_install_mac.sh
  3. 18
    0
      cmake/travis_script_mac.sh
  4. 3
    0
      src/deps/imgui/imconfig.h
  5. 722
    355
      src/deps/imgui/imgui.cpp
  6. 75
    49
      src/deps/imgui/imgui.h

+ 1
- 0
ChangeLog.md View File

6
     * No longer including gl.h globally, now only using gl33.h where needed.
6
     * No longer including gl.h globally, now only using gl33.h where needed.
7
     * No longer including all of glm globally, only the vec2/3/4 and mat4x4.
7
     * No longer including all of glm globally, only the vec2/3/4 and mat4x4.
8
     * No longer re-defining our own assert(), now called orAssert().
8
     * No longer re-defining our own assert(), now called orAssert().
9
+    * Updated imgui to version 1.37
9
 
10
 
10
     [ 20150318 ]
11
     [ 20150318 ]
11
     * Updated imgui to version 1.36
12
     * Updated imgui to version 1.36

+ 1
- 1
cmake/travis_install_mac.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-brew install sdl2 sdl2_ttf freealut glm glbinding
3
+brew install sdl2 sdl2_ttf freealut glm
4
 
4
 

+ 18
- 0
cmake/travis_script_mac.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
+# Need to build latest glbinding from source
4
+#GLBVER=`curl https://api.github.com/repos/hpicgs/glbinding/releases/latest | grep -m1 tag_name | cut -d\" -f4`
5
+#curl -L https://github.com/hpicgs/glbinding/archive/${GLBVER}.tar.gz | tar xzf -
6
+#cd glbinding-${GLBVER#v}
7
+
8
+# Need to use master until a fixed version is released
9
+git clone https://github.com/hpicgs/glbinding.git
10
+cd glbinding
11
+
12
+mkdir build
13
+cd build
14
+cmake ..
15
+make -j4
16
+sudo make install
17
+cd ..
18
+cd ..
19
+
20
+# Build OpenRaider and run the unit tests
3
 mkdir build && cd build && cmake .. && make -j 4 && make check
21
 mkdir build && cd build && cmake .. && make -j 4 && make check
4
 
22
 

+ 3
- 0
src/deps/imgui/imconfig.h View File

23
 //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS
23
 //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS
24
 //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS
24
 //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS
25
 
25
 
26
+//---- Don't implement help and test window functionality (ShowUserGuide()/ShowStyleEditor()/ShowTestWindow() methods will be empty)
27
+//#define IMGUI_DISABLE_TEST_WINDOWS
28
+
26
 //---- Include imgui_user.inl at the end of imgui.cpp so you can include code that extends ImGui using its private data/functions.
29
 //---- Include imgui_user.inl at the end of imgui.cpp so you can include code that extends ImGui using its private data/functions.
27
 #define IMGUI_INCLUDE_IMGUI_USER_INL
30
 #define IMGUI_INCLUDE_IMGUI_USER_INL
28
 
31
 

+ 722
- 355
src/deps/imgui/imgui.cpp
File diff suppressed because it is too large
View File


+ 75
- 49
src/deps/imgui/imgui.h View File

1
-// ImGui library v1.37 WIP
1
+// ImGui library v1.37
2
 // See .cpp file for documentation.
2
 // See .cpp file for documentation.
3
 // See ImGui::ShowTestWindow() for sample code.
3
 // See ImGui::ShowTestWindow() for sample code.
4
 // Read 'Programmer guide' in .cpp for notes on how to setup ImGui in your codebase.
4
 // Read 'Programmer guide' in .cpp for notes on how to setup ImGui in your codebase.
9
 #include "imconfig.h"       // User-editable configuration file
9
 #include "imconfig.h"       // User-editable configuration file
10
 #include <float.h>          // FLT_MAX
10
 #include <float.h>          // FLT_MAX
11
 #include <stdarg.h>         // va_list
11
 #include <stdarg.h>         // va_list
12
-#include <stddef.h>         // ptrdiff_t
13
-#include <stdlib.h>         // NULL, malloc
14
-#include <string.h>         // memset, memmove
12
+#include <stddef.h>         // ptrdiff_t, NULL
13
+#include <stdlib.h>         // NULL, malloc, free, qsort, atoi
14
+#include <string.h>         // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
15
 
15
 
16
-#define IMGUI_VERSION       "1.37 WIP"
16
+#define IMGUI_VERSION       "1.37"
17
 
17
 
18
 // Define assertion handler.
18
 // Define assertion handler.
19
 #ifndef IM_ASSERT
19
 #ifndef IM_ASSERT
43
 typedef int ImGuiStyleVar;          // enum ImGuiStyleVar_
43
 typedef int ImGuiStyleVar;          // enum ImGuiStyleVar_
44
 typedef int ImGuiKey;               // enum ImGuiKey_
44
 typedef int ImGuiKey;               // enum ImGuiKey_
45
 typedef int ImGuiColorEditMode;     // enum ImGuiColorEditMode_
45
 typedef int ImGuiColorEditMode;     // enum ImGuiColorEditMode_
46
+typedef int ImGuiMouseCursor;       // enum ImGuiMouseCursor_
46
 typedef int ImGuiWindowFlags;       // enum ImGuiWindowFlags_
47
 typedef int ImGuiWindowFlags;       // enum ImGuiWindowFlags_
47
-typedef int ImGuiSetCond;           // enum ImGuiSetCondition_
48
+typedef int ImGuiSetCond;           // enum ImGuiSetCond_
48
 typedef int ImGuiInputTextFlags;    // enum ImGuiInputTextFlags_
49
 typedef int ImGuiInputTextFlags;    // enum ImGuiInputTextFlags_
49
 struct ImGuiTextEditCallbackData;   // for advanced uses of InputText() 
50
 struct ImGuiTextEditCallbackData;   // for advanced uses of InputText() 
50
 typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data);
51
 typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data);
161
 
162
 
162
     // Window
163
     // Window
163
     // See implementation in .cpp for details
164
     // See implementation in .cpp for details
164
-    IMGUI_API bool          Begin(const char* name = "Debug", bool* p_opened = NULL, const ImVec2& initial_size = ImVec2(0,0), float bg_alpha = -1.0f, ImGuiWindowFlags flags = 0); // return false when window is collapsed, so you can early out in your code. passing 'bool* p_opened' displays a Close button on the upper-right corner of the window, the pointed value will be set to false when the button is pressed.
165
+    IMGUI_API bool          Begin(const char* name = "Debug", bool* p_opened = NULL, ImGuiWindowFlags flags = 0);                                           // return false when window is collapsed, so you can early out in your code. 'bool* p_opened' creates a widget on the upper-right to close the window (which sets your bool to false). 
166
+    IMGUI_API bool          Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_use, float bg_alpha = -1.0f, ImGuiWindowFlags flags = 0);   // this is the older/longer API. call SetNextWindowSize() instead if you want to set a window size. For regular windows, 'size_on_first_use' only applies to the first time EVER the window is created and probably not what you want! maybe obsolete this API eventually.
165
     IMGUI_API void          End();
167
     IMGUI_API void          End();
166
-    IMGUI_API bool          BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0);            // size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). on each axis.
167
-    IMGUI_API bool          BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0);                    // "
168
+    IMGUI_API bool          BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0);        // size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). on each axis.
169
+    IMGUI_API bool          BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0);                // "
168
     IMGUI_API void          EndChild();
170
     IMGUI_API void          EndChild();
169
     IMGUI_API ImVec2        GetContentRegionMax();                                              // window or current column boundaries, in windows coordinates
171
     IMGUI_API ImVec2        GetContentRegionMax();                                              // window or current column boundaries, in windows coordinates
170
     IMGUI_API ImVec2        GetWindowContentRegionMin();                                        // window boundaries, in windows coordinates
172
     IMGUI_API ImVec2        GetWindowContentRegionMin();                                        // window boundaries, in windows coordinates
171
     IMGUI_API ImVec2        GetWindowContentRegionMax();
173
     IMGUI_API ImVec2        GetWindowContentRegionMax();
172
-    IMGUI_API ImDrawList*   GetWindowDrawList();                                                // get rendering command-list if you want to append your own draw primitives.
174
+    IMGUI_API ImDrawList*   GetWindowDrawList();                                                // get rendering command-list if you want to append your own draw primitives
173
     IMGUI_API ImFont*       GetWindowFont();
175
     IMGUI_API ImFont*       GetWindowFont();
174
     IMGUI_API float         GetWindowFontSize();                                                // size (also height in pixels) of current font with current scale applied
176
     IMGUI_API float         GetWindowFontSize();                                                // size (also height in pixels) of current font with current scale applied
175
-    IMGUI_API void          SetWindowFontScale(float scale);                                    // per-window font scale. Adjust IO.FontGlobalScale if you want to scale all windows.
176
-    IMGUI_API ImVec2        GetWindowPos();                                                     // you should rarely need/care about the window position, but it can be useful if you want to do your own drawing.
177
-    IMGUI_API ImVec2        GetWindowSize();                                                    // get current window position.
177
+    IMGUI_API void          SetWindowFontScale(float scale);                                    // per-window font scale. Adjust IO.FontGlobalScale if you want to scale all windows
178
+    IMGUI_API ImVec2        GetWindowPos();                                                     // you should rarely need/care about the window position, but it can be useful if you want to do your own drawing
179
+    IMGUI_API ImVec2        GetWindowSize();                                                    // get current window position
178
     IMGUI_API float         GetWindowWidth();
180
     IMGUI_API float         GetWindowWidth();
179
     IMGUI_API bool          GetWindowCollapsed();
181
     IMGUI_API bool          GetWindowCollapsed();
180
 
182
 
181
-    IMGUI_API void          SetNextWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0);         // set next window position - call before Begin().
182
-    IMGUI_API void          SetNextWindowSize(const ImVec2& size, ImGuiSetCond cond = 0);       // set next window size. set to ImVec2(0,0) to force an auto-fit.
183
-    IMGUI_API void          SetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0);      // set next window collapsed state.
183
+    IMGUI_API void          SetNextWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0);         // set next window position - call before Begin()
184
+    IMGUI_API void          SetNextWindowSize(const ImVec2& size, ImGuiSetCond cond = 0);       // set next window size. set to ImVec2(0,0) to force an auto-fit
185
+    IMGUI_API void          SetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0);      // set next window collapsed state
184
     IMGUI_API void          SetNextWindowFocus();                                               // set next window to be focused / front-most
186
     IMGUI_API void          SetNextWindowFocus();                                               // set next window to be focused / front-most
185
-    IMGUI_API void          SetWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0);             // set current window position - call within Begin()/End(). may incur tearing.
186
-    IMGUI_API void          SetWindowSize(const ImVec2& size, ImGuiSetCond cond = 0);           // set current window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing.
187
-    IMGUI_API void          SetWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0);          // set current window collapsed state.
187
+    IMGUI_API void          SetWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0);             // set current window position - call within Begin()/End(). may incur tearing
188
+    IMGUI_API void          SetWindowSize(const ImVec2& size, ImGuiSetCond cond = 0);           // set current window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing
189
+    IMGUI_API void          SetWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0);          // set current window collapsed state
188
     IMGUI_API void          SetWindowFocus();                                                   // set current window to be focused / front-most
190
     IMGUI_API void          SetWindowFocus();                                                   // set current window to be focused / front-most
189
-    IMGUI_API void          SetWindowPos(const char* name, const ImVec2& pos, ImGuiSetCond cond = 0);      // set named window position - call within Begin()/End(). may incur tearing.
190
-    IMGUI_API void          SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond = 0);    // set named window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing.
191
-    IMGUI_API void          SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCond cond = 0);   // set named window collapsed state.
191
+    IMGUI_API void          SetWindowPos(const char* name, const ImVec2& pos, ImGuiSetCond cond = 0);      // set named window position - call within Begin()/End(). may incur tearing
192
+    IMGUI_API void          SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond = 0);    // set named window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing
193
+    IMGUI_API void          SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCond cond = 0);   // set named window collapsed state
192
     IMGUI_API void          SetWindowFocus(const char* name);                                              // set named window to be focused / front-most
194
     IMGUI_API void          SetWindowFocus(const char* name);                                              // set named window to be focused / front-most
193
 
195
 
194
-    IMGUI_API float         GetScrollPosY();                                                    // get scrolling position (0..GetScrollMaxY())
196
+    IMGUI_API float         GetScrollPosY();                                                    // get scrolling position [0..GetScrollMaxY()]
195
     IMGUI_API float         GetScrollMaxY();                                                    // get maximum scrolling position == ContentSize.Y - WindowSize.Y
197
     IMGUI_API float         GetScrollMaxY();                                                    // get maximum scrolling position == ContentSize.Y - WindowSize.Y
196
-    IMGUI_API void          SetScrollPosHere();                                                 // adjust scrolling position to center into the current cursor position.
197
-    IMGUI_API void          SetKeyboardFocusHere(int offset = 0);                               // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget.
198
-    IMGUI_API void          SetStateStorage(ImGuiStorage* tree);                                // replace tree state storage with our own (if you want to manipulate it yourself, typically clear subsection of it).
198
+    IMGUI_API void          SetScrollPosHere();                                                 // adjust scrolling position to center into the current cursor position
199
+    IMGUI_API void          SetKeyboardFocusHere(int offset = 0);                               // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget
200
+    IMGUI_API void          SetStateStorage(ImGuiStorage* tree);                                // replace tree state storage with our own (if you want to manipulate it yourself, typically clear subsection of it)
199
     IMGUI_API ImGuiStorage* GetStateStorage();
201
     IMGUI_API ImGuiStorage* GetStateStorage();
200
 
202
 
201
     // Parameters stacks (shared)
203
     // Parameters stacks (shared)
211
     IMGUI_API void          PushItemWidth(float item_width);                                    // width of items for the common item+label case, pixels. 0.0f = default to ~2/3 of windows width, >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -0.01f always align width to the right side)
213
     IMGUI_API void          PushItemWidth(float item_width);                                    // width of items for the common item+label case, pixels. 0.0f = default to ~2/3 of windows width, >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -0.01f always align width to the right side)
212
     IMGUI_API void          PopItemWidth();
214
     IMGUI_API void          PopItemWidth();
213
     IMGUI_API float         CalcItemWidth();                                                    // width of item given pushed settings and current cursor position
215
     IMGUI_API float         CalcItemWidth();                                                    // width of item given pushed settings and current cursor position
214
-    IMGUI_API void          PushAllowKeyboardFocus(bool v);                                     // allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets.
216
+    IMGUI_API void          PushAllowKeyboardFocus(bool v);                                     // allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
215
     IMGUI_API void          PopAllowKeyboardFocus();
217
     IMGUI_API void          PopAllowKeyboardFocus();
216
-    IMGUI_API void          PushTextWrapPos(float wrap_pos_x = 0.0f);                           // word-wrapping for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space.
218
+    IMGUI_API void          PushTextWrapPos(float wrap_pos_x = 0.0f);                           // word-wrapping for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space
217
     IMGUI_API void          PopTextWrapPos();
219
     IMGUI_API void          PopTextWrapPos();
218
 
220
 
219
     // Tooltip
221
     // Tooltip
220
-    IMGUI_API void          SetTooltip(const char* fmt, ...);                                   // set tooltip under mouse-cursor, typically use with ImGui::IsHovered(). last call wins.
222
+    IMGUI_API void          SetTooltip(const char* fmt, ...);                                   // set tooltip under mouse-cursor, typically use with ImGui::IsHovered(). last call wins
221
     IMGUI_API void          SetTooltipV(const char* fmt, va_list args);
223
     IMGUI_API void          SetTooltipV(const char* fmt, va_list args);
222
-    IMGUI_API void          BeginTooltip();                                                     // use to create full-featured tooltip windows that aren't just text.
224
+    IMGUI_API void          BeginTooltip();                                                     // use to create full-featured tooltip windows that aren't just text
223
     IMGUI_API void          EndTooltip();
225
     IMGUI_API void          EndTooltip();
224
 
226
 
227
+    // Popup
228
+    IMGUI_API void          BeginPopup(bool* p_opened);
229
+    IMGUI_API void          EndPopup();
230
+
225
     // Layout
231
     // Layout
226
     IMGUI_API void          BeginGroup();
232
     IMGUI_API void          BeginGroup();
227
     IMGUI_API void          EndGroup();
233
     IMGUI_API void          EndGroup();
233
     IMGUI_API void          Columns(int count = 1, const char* id = NULL, bool border=true);    // setup number of columns
239
     IMGUI_API void          Columns(int count = 1, const char* id = NULL, bool border=true);    // setup number of columns
234
     IMGUI_API void          NextColumn();                                                       // next column
240
     IMGUI_API void          NextColumn();                                                       // next column
235
     IMGUI_API int           GetColumnIndex();                                                   // get current column index
241
     IMGUI_API int           GetColumnIndex();                                                   // get current column index
236
-    IMGUI_API float         GetColumnOffset(int column_index = -1);                             // get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetcolumnsCount() inclusive. column 0 is usually 0.0f and not resizable unless you call this.
237
-    IMGUI_API void          SetColumnOffset(int column_index, float offset_x);                  // set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column.
242
+    IMGUI_API float         GetColumnOffset(int column_index = -1);                             // get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetcolumnsCount() inclusive. column 0 is usually 0.0f and not resizable unless you call this
243
+    IMGUI_API void          SetColumnOffset(int column_index, float offset_x);                  // set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column
238
     IMGUI_API float         GetColumnWidth(int column_index = -1);                              // column width (== GetColumnOffset(GetColumnIndex()+1) - GetColumnOffset(GetColumnOffset())
244
     IMGUI_API float         GetColumnWidth(int column_index = -1);                              // column width (== GetColumnOffset(GetColumnIndex()+1) - GetColumnOffset(GetColumnOffset())
239
     IMGUI_API int           GetColumnsCount();                                                  // number of columns (what was passed to Columns())
245
     IMGUI_API int           GetColumnsCount();                                                  // number of columns (what was passed to Columns())
240
     IMGUI_API ImVec2        GetCursorPos();                                                     // cursor position is relative to window position
246
     IMGUI_API ImVec2        GetCursorPos();                                                     // cursor position is relative to window position
243
     IMGUI_API void          SetCursorPos(const ImVec2& pos);                                    // "
249
     IMGUI_API void          SetCursorPos(const ImVec2& pos);                                    // "
244
     IMGUI_API void          SetCursorPosX(float x);                                             // "
250
     IMGUI_API void          SetCursorPosX(float x);                                             // "
245
     IMGUI_API void          SetCursorPosY(float y);                                             // "
251
     IMGUI_API void          SetCursorPosY(float y);                                             // "
246
-    IMGUI_API ImVec2        GetCursorScreenPos();                                               // cursor position in absolute screen coordinates (0..io.DisplaySize)
247
-    IMGUI_API void          SetCursorScreenPos(const ImVec2& pos);                              // cursor position in absolute screen coordinates (0..io.DisplaySize)
248
-    IMGUI_API void          AlignFirstTextHeightToWidgets();                                    // call once if the first item on the line is a Text() item and you want to vertically lower it to match subsequent (bigger) widgets.
252
+    IMGUI_API ImVec2        GetCursorScreenPos();                                               // cursor position in absolute screen coordinates [0..io.DisplaySize]
253
+    IMGUI_API void          SetCursorScreenPos(const ImVec2& pos);                              // cursor position in absolute screen coordinates [0..io.DisplaySize]
254
+    IMGUI_API void          AlignFirstTextHeightToWidgets();                                    // call once if the first item on the line is a Text() item and you want to vertically lower it to match subsequent (bigger) widgets
249
     IMGUI_API float         GetTextLineHeight();                                                // height of font == GetWindowFontSize()
255
     IMGUI_API float         GetTextLineHeight();                                                // height of font == GetWindowFontSize()
250
     IMGUI_API float         GetTextLineHeightWithSpacing();                                     // spacing (in pixels) between 2 consecutive lines of text == GetWindowFontSize() + GetStyle().ItemSpacing.y
256
     IMGUI_API float         GetTextLineHeightWithSpacing();                                     // spacing (in pixels) between 2 consecutive lines of text == GetWindowFontSize() + GetStyle().ItemSpacing.y
251
 
257
 
252
     // ID scopes
258
     // ID scopes
253
-    // If you are creating widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them.
259
+    // If you are creating widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them
254
     // You can also use "##extra" within your widget name to distinguish them from each others (see 'Programmer Guide')
260
     // You can also use "##extra" within your widget name to distinguish them from each others (see 'Programmer Guide')
255
     IMGUI_API void          PushID(const char* str_id);                                         // push identifier into the ID stack. IDs are hash of the *entire* stack!
261
     IMGUI_API void          PushID(const char* str_id);                                         // push identifier into the ID stack. IDs are hash of the *entire* stack!
256
     IMGUI_API void          PushID(const void* ptr_id);
262
     IMGUI_API void          PushID(const void* ptr_id);
257
     IMGUI_API void          PushID(const int int_id);
263
     IMGUI_API void          PushID(const int int_id);
258
     IMGUI_API void          PopID();
264
     IMGUI_API void          PopID();
259
-    IMGUI_API ImGuiID       GetID(const char* str_id);                                          // calculate unique ID (hash of whole ID stack + given parameter). useful if you want to query into ImGuiStorage yourself. otherwise rarely needed.
265
+    IMGUI_API ImGuiID       GetID(const char* str_id);                                          // calculate unique ID (hash of whole ID stack + given parameter). useful if you want to query into ImGuiStorage yourself. otherwise rarely needed
260
     IMGUI_API ImGuiID       GetID(const void* ptr_id);
266
     IMGUI_API ImGuiID       GetID(const void* ptr_id);
261
 
267
 
262
     // Widgets
268
     // Widgets
266
     IMGUI_API void          TextColoredV(const ImVec4& col, const char* fmt, va_list args);
272
     IMGUI_API void          TextColoredV(const ImVec4& col, const char* fmt, va_list args);
267
     IMGUI_API void          TextWrapped(const char* fmt, ...);                                  // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();
273
     IMGUI_API void          TextWrapped(const char* fmt, ...);                                  // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();
268
     IMGUI_API void          TextWrappedV(const char* fmt, va_list args);
274
     IMGUI_API void          TextWrappedV(const char* fmt, va_list args);
269
-    IMGUI_API void          TextUnformatted(const char* text, const char* text_end = NULL);     // doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, recommended for long chunks of text.
275
+    IMGUI_API void          TextUnformatted(const char* text, const char* text_end = NULL);     // doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, recommended for long chunks of text
270
     IMGUI_API void          LabelText(const char* label, const char* fmt, ...);                 // display text+label aligned the same way as value+label widgets 
276
     IMGUI_API void          LabelText(const char* label, const char* fmt, ...);                 // display text+label aligned the same way as value+label widgets 
271
     IMGUI_API void          LabelTextV(const char* label, const char* fmt, va_list args);
277
     IMGUI_API void          LabelTextV(const char* label, const char* fmt, va_list args);
272
     IMGUI_API void          Bullet();
278
     IMGUI_API void          Bullet();
276
     IMGUI_API bool          SmallButton(const char* label);
282
     IMGUI_API bool          SmallButton(const char* label);
277
     IMGUI_API bool          InvisibleButton(const char* str_id, const ImVec2& size);
283
     IMGUI_API bool          InvisibleButton(const char* str_id, const ImVec2& size);
278
     IMGUI_API void          Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), const ImVec4& tint_col = ImVec4(1,1,1,1), const ImVec4& border_col = ImVec4(0,0,0,0));
284
     IMGUI_API void          Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), const ImVec4& tint_col = ImVec4(1,1,1,1), const ImVec4& border_col = ImVec4(0,0,0,0));
279
-    IMGUI_API bool          ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0),  const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,1), const ImVec4& tint_col = ImVec4(1,1,1,1));    // <0 frame_padding uses default frame padding settings. 0 for no paddnig.
285
+    IMGUI_API bool          ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0),  const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,1), const ImVec4& tint_col = ImVec4(1,1,1,1));    // <0 frame_padding uses default frame padding settings. 0 for no padding
280
     IMGUI_API bool          CollapsingHeader(const char* label, const char* str_id = NULL, bool display_frame = true, bool default_open = false);
286
     IMGUI_API bool          CollapsingHeader(const char* label, const char* str_id = NULL, bool display_frame = true, bool default_open = false);
281
-    IMGUI_API bool          SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);     // adjust display_format to decorate the value with a prefix or a suffix. Use power!=1.0 for logarithmic sliders.
287
+    IMGUI_API bool          SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);     // adjust display_format to decorate the value with a prefix or a suffix. Use power!=1.0 for logarithmic sliders
282
     IMGUI_API bool          SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
288
     IMGUI_API bool          SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
283
     IMGUI_API bool          SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
289
     IMGUI_API bool          SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
284
     IMGUI_API bool          SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
290
     IMGUI_API bool          SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
326
     IMGUI_API void          SetNextTreeNodeOpened(bool opened, ImGuiSetCond cond = 0);          // set next tree node to be opened.
332
     IMGUI_API void          SetNextTreeNodeOpened(bool opened, ImGuiSetCond cond = 0);          // set next tree node to be opened.
327
 
333
 
328
     // Selectable / Lists
334
     // Selectable / Lists
329
-    IMGUI_API bool          Selectable(const char* label, bool selected, const ImVec2& size = ImVec2(0,0));
335
+    IMGUI_API bool          Selectable(const char* label, bool selected = false, const ImVec2& size = ImVec2(0,0));
330
     IMGUI_API bool          Selectable(const char* label, bool* p_selected, const ImVec2& size = ImVec2(0,0));
336
     IMGUI_API bool          Selectable(const char* label, bool* p_selected, const ImVec2& size = ImVec2(0,0));
331
     IMGUI_API bool          ListBox(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
337
     IMGUI_API bool          ListBox(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
332
     IMGUI_API bool          ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
338
     IMGUI_API bool          ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
352
 
358
 
353
     // Utilities
359
     // Utilities
354
     IMGUI_API bool          IsItemHovered();                                                    // was the last item hovered by mouse?
360
     IMGUI_API bool          IsItemHovered();                                                    // was the last item hovered by mouse?
355
-    IMGUI_API bool          IsItemHoveredRectOnly();                                            // was the last item hovered by mouse? even if another item is active while we are hovering this.
361
+    IMGUI_API bool          IsItemHoveredRect();                                                // was the last item hovered by mouse? even if another item is active while we are hovering this
356
     IMGUI_API bool          IsItemActive();                                                     // was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
362
     IMGUI_API bool          IsItemActive();                                                     // was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
357
     IMGUI_API bool          IsAnyItemActive();                                                  // 
363
     IMGUI_API bool          IsAnyItemActive();                                                  // 
358
-    IMGUI_API ImVec2        GetItemActiveDragDelta();                                           // mouse delta from the time the item first got active
359
     IMGUI_API ImVec2        GetItemRectMin();                                                   // get bounding rect of last item
364
     IMGUI_API ImVec2        GetItemRectMin();                                                   // get bounding rect of last item
360
     IMGUI_API ImVec2        GetItemRectMax();                                                   // "
365
     IMGUI_API ImVec2        GetItemRectMax();                                                   // "
361
     IMGUI_API ImVec2        GetItemRectSize();                                                  // "
366
     IMGUI_API ImVec2        GetItemRectSize();                                                  // "
369
     IMGUI_API bool          IsMouseHoveringWindow();                                            // is mouse hovering current window ("window" in API names always refer to current window)
374
     IMGUI_API bool          IsMouseHoveringWindow();                                            // is mouse hovering current window ("window" in API names always refer to current window)
370
     IMGUI_API bool          IsMouseHoveringAnyWindow();                                         // is mouse hovering any active imgui window
375
     IMGUI_API bool          IsMouseHoveringAnyWindow();                                         // is mouse hovering any active imgui window
371
     IMGUI_API bool          IsMouseHoveringRect(const ImVec2& rect_min, const ImVec2& rect_max);// is mouse hovering given bounding rect
376
     IMGUI_API bool          IsMouseHoveringRect(const ImVec2& rect_min, const ImVec2& rect_max);// is mouse hovering given bounding rect
377
+    IMGUI_API bool          IsMouseDragging(int button = 0, float lock_threshold = -1.0f);      // is mouse dragging. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
372
     IMGUI_API bool          IsPosHoveringAnyWindow(const ImVec2& pos);                          // is given position hovering any active imgui window
378
     IMGUI_API bool          IsPosHoveringAnyWindow(const ImVec2& pos);                          // is given position hovering any active imgui window
373
     IMGUI_API ImVec2        GetMousePos();                                                      // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
379
     IMGUI_API ImVec2        GetMousePos();                                                      // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
380
+    IMGUI_API ImVec2        GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f);    // dragging amount since clicking, also see: GetItemActiveDragDelta(). if lock_threshold < -1.0f uses io.MouseDraggingThreshold
381
+    IMGUI_API ImGuiMouseCursor GetMouseCursor();                                                // get desired cursor type, reset in ImGui::NewFrame(), this updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
382
+    IMGUI_API void          SetMouseCursor(ImGuiMouseCursor type);                              // set desired cursor type
374
     IMGUI_API float         GetTime();
383
     IMGUI_API float         GetTime();
375
     IMGUI_API int           GetFrameCount();
384
     IMGUI_API int           GetFrameCount();
376
     IMGUI_API const char*   GetStyleColName(ImGuiCol idx);
385
     IMGUI_API const char*   GetStyleColName(ImGuiCol idx);
377
-    IMGUI_API ImVec2        CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = +0.0f);   // utility to find the closest point the last item bounding rectangle edge. useful to visually link items.
386
+    IMGUI_API ImVec2        CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = +0.0f);   // utility to find the closest point the last item bounding rectangle edge. useful to visually link items
378
     IMGUI_API ImVec2        CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
387
     IMGUI_API ImVec2        CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
379
-    IMGUI_API void          CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end);    // helper to manually clip large list of items. see comments in implementation.
388
+    IMGUI_API void          CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end);    // helper to manually clip large list of items. see comments in implementation
380
 
389
 
381
-    IMGUI_API void          BeginChildFrame(ImGuiID id, const ImVec2& size);                    // helper to create a child window / scrolling region that looks like a normal widget frame.
390
+    IMGUI_API void          BeginChildFrame(ImGuiID id, const ImVec2& size);                    // helper to create a child window / scrolling region that looks like a normal widget frame
382
     IMGUI_API void          EndChildFrame();
391
     IMGUI_API void          EndChildFrame();
383
 
392
 
384
     IMGUI_API ImU32         ColorConvertFloat4ToU32(const ImVec4& in);
393
     IMGUI_API ImU32         ColorConvertFloat4ToU32(const ImVec4& in);
419
     ImGuiWindowFlags_ChildWindowAutoFitX    = 1 << 10,  // For internal use by BeginChild()
428
     ImGuiWindowFlags_ChildWindowAutoFitX    = 1 << 10,  // For internal use by BeginChild()
420
     ImGuiWindowFlags_ChildWindowAutoFitY    = 1 << 11,  // For internal use by BeginChild()
429
     ImGuiWindowFlags_ChildWindowAutoFitY    = 1 << 11,  // For internal use by BeginChild()
421
     ImGuiWindowFlags_ComboBox               = 1 << 12,  // For internal use by ComboBox()
430
     ImGuiWindowFlags_ComboBox               = 1 << 12,  // For internal use by ComboBox()
422
-    ImGuiWindowFlags_Tooltip                = 1 << 13   // For internal use by BeginTooltip()
431
+    ImGuiWindowFlags_Tooltip                = 1 << 13,  // For internal use by BeginTooltip()
432
+    ImGuiWindowFlags_Popup                  = 1 << 14   // For internal use by BeginPopup()
423
 };
433
 };
424
 
434
 
425
 // Flags for ImGui::InputText()
435
 // Flags for ImGui::InputText()
532
     ImGuiColorEditMode_HEX = 2
542
     ImGuiColorEditMode_HEX = 2
533
 };
543
 };
534
 
544
 
545
+// Enumeration for GetMouseCursor()
546
+enum ImGuiMouseCursor_
547
+{
548
+    ImGuiMouseCursor_Arrow = 0,
549
+    ImGuiMouseCursor_TextInput,
550
+    ImGuiMouseCursor_Move,                  // Unused by ImGui
551
+    ImGuiMouseCursor_ResizeNS,              // Unused by ImGui
552
+    ImGuiMouseCursor_ResizeEW,              // Unused by ImGui
553
+    ImGuiMouseCursor_ResizeNESW,            // Unused by ImGui
554
+    ImGuiMouseCursor_ResizeNWSE,
555
+    ImGuiMouseCursor_Count_
556
+};
557
+
535
 // Condition flags for ImGui::SetWindow***(), SetNextWindow***(), SetNextTreeNode***() functions
558
 // Condition flags for ImGui::SetWindow***(), SetNextWindow***(), SetNextTreeNode***() functions
536
 // All those functions treat 0 as a shortcut to ImGuiSetCond_Always
559
 // All those functions treat 0 as a shortcut to ImGuiSetCond_Always
537
 enum ImGuiSetCond_
560
 enum ImGuiSetCond_
559
     float       ColumnsMinSpacing;          // Minimum horizontal spacing between two columns
582
     float       ColumnsMinSpacing;          // Minimum horizontal spacing between two columns
560
     float       ScrollbarWidth;             // Width of the vertical scrollbar
583
     float       ScrollbarWidth;             // Width of the vertical scrollbar
561
     float       GrabMinSize;                // Minimum width/height of a slider or scrollbar grab
584
     float       GrabMinSize;                // Minimum width/height of a slider or scrollbar grab
585
+    ImVec2      DisplaySafeAreaPadding;     // Window positions are clamped to be visible within the display area. If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding.
562
     ImVec4      Colors[ImGuiCol_COUNT];
586
     ImVec4      Colors[ImGuiCol_COUNT];
563
 
587
 
564
     IMGUI_API ImGuiStyle();
588
     IMGUI_API ImGuiStyle();
579
     const char*   LogFilename;              // = "imgui_log.txt"    // Path to .log file (default parameter to ImGui::LogToFile when no file is specified).
603
     const char*   LogFilename;              // = "imgui_log.txt"    // Path to .log file (default parameter to ImGui::LogToFile when no file is specified).
580
     float         MouseDoubleClickTime;     // = 0.30f              // Time for a double-click, in seconds.
604
     float         MouseDoubleClickTime;     // = 0.30f              // Time for a double-click, in seconds.
581
     float         MouseDoubleClickMaxDist;  // = 6.0f               // Distance threshold to stay in to validate a double-click, in pixels.
605
     float         MouseDoubleClickMaxDist;  // = 6.0f               // Distance threshold to stay in to validate a double-click, in pixels.
606
+    float         MouseDragThreshold;       // = 6.0f               // Distance threshold before considering we are dragging
582
     int           KeyMap[ImGuiKey_COUNT];   // <unset>              // Map of indices into the KeysDown[512] entries array
607
     int           KeyMap[ImGuiKey_COUNT];   // <unset>              // Map of indices into the KeysDown[512] entries array
583
     void*         UserData;                 // = NULL               // Store your own data for retrieval by callbacks.
608
     void*         UserData;                 // = NULL               // Store your own data for retrieval by callbacks.
584
 
609
 
648
     bool        MouseDoubleClicked[5];      // Has mouse button been double-clicked?
673
     bool        MouseDoubleClicked[5];      // Has mouse button been double-clicked?
649
     bool        MouseDownOwned[5];          // Track if button was clicked inside a window. We don't request mouse capture from the application if click started outside ImGui bounds.
674
     bool        MouseDownOwned[5];          // Track if button was clicked inside a window. We don't request mouse capture from the application if click started outside ImGui bounds.
650
     float       MouseDownTime[5];           // Time the mouse button has been down
675
     float       MouseDownTime[5];           // Time the mouse button has been down
676
+    float       MouseDragMaxDistanceSqr[5]; // Squared maximum distance of how much mouse has traveled from the click point
651
     float       KeysDownTime[512];          // Time the keyboard key has been down
677
     float       KeysDownTime[512];          // Time the keyboard key has been down
652
 
678
 
653
     IMGUI_API   ImGuiIO();
679
     IMGUI_API   ImGuiIO();
861
 
887
 
862
     ImDrawList() { Clear(); }
888
     ImDrawList() { Clear(); }
863
     IMGUI_API void  Clear();
889
     IMGUI_API void  Clear();
890
+    IMGUI_API void  ClearFreeMemory();
864
     IMGUI_API void  PushClipRect(const ImVec4& clip_rect);          // Scissoring. The values are x1, y1, x2, y2.
891
     IMGUI_API void  PushClipRect(const ImVec4& clip_rect);          // Scissoring. The values are x1, y1, x2, y2.
865
     IMGUI_API void  PushClipRectFullScreen();
892
     IMGUI_API void  PushClipRectFullScreen();
866
     IMGUI_API void  PopClipRect();
893
     IMGUI_API void  PopClipRect();
931
     unsigned int*               TexPixelsRGBA32;    // 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
958
     unsigned int*               TexPixelsRGBA32;    // 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
932
     int                         TexWidth;
959
     int                         TexWidth;
933
     int                         TexHeight;
960
     int                         TexHeight;
934
-    ImVec2                      TexExtraDataPos;    // Position of our rectangle where we draw non-font graphics
935
     ImVec2                      TexUvWhitePixel;    // Texture coordinates to a white pixel (part of the TexExtraData block)
961
     ImVec2                      TexUvWhitePixel;    // Texture coordinates to a white pixel (part of the TexExtraData block)
936
     ImVector<ImFont*>           Fonts;
962
     ImVector<ImFont*>           Fonts;
937
 
963
 
940
     ImVector<ImFontAtlasData*>  InputData;          // Internal data
966
     ImVector<ImFontAtlasData*>  InputData;          // Internal data
941
     IMGUI_API bool              Build();            // Build pixels data. This is automatically for you by the GetTexData*** functions.
967
     IMGUI_API bool              Build();            // Build pixels data. This is automatically for you by the GetTexData*** functions.
942
     IMGUI_API void              ClearInputData();   // Clear the input TTF data.
968
     IMGUI_API void              ClearInputData();   // Clear the input TTF data.
943
-    IMGUI_API void              RenderCustomTexData();
969
+    IMGUI_API void              RenderCustomTexData(int pass, void* rects);
944
 };
970
 };
945
 
971
 
946
 // TTF font loading and rendering
972
 // TTF font loading and rendering

Loading…
Cancel
Save