Pārlūkot izejas kodu

Updated imgui, added consoleAction.

Thomas Buck 9 gadus atpakaļ
vecāks
revīzija
abb4445957

+ 3
- 0
ChangeLog.md Parādīt failu

5
     [ 20140107 ]
5
     [ 20140107 ]
6
     * Fixed problems with FontTTFs Glyph Baseline
6
     * Fixed problems with FontTTFs Glyph Baseline
7
     * No longer using wrong assert() when glm is included
7
     * No longer using wrong assert() when glm is included
8
+    * Updated imgui, now Version 1.20
9
+    * Every imgui window is displayed separately and with close button
10
+    * Added consoleAction, defaulting to backquoteKey
8
 
11
 
9
     [ 20150106 ]
12
     [ 20150106 ]
10
     * Removed SDL2-TTF Font implementation
13
     * Removed SDL2-TTF Font implementation

+ 1
- 0
data/OpenRaider.ini Parādīt failu

22
 
22
 
23
 bind menu     "escape"
23
 bind menu     "escape"
24
 bind debug    'q'
24
 bind debug    'q'
25
+bind console  "backquote"
25
 bind forward  'w'
26
 bind forward  'w'
26
 bind backward 's'
27
 bind backward 's'
27
 bind left     'a'
28
 bind left     'a'

+ 5
- 2
include/Console.h Parādīt failu

17
   public:
17
   public:
18
     static void display();
18
     static void display();
19
 
19
 
20
+    static bool isVisible() { return visible; }
21
+    static void setVisible(bool v) { visible = v; }
22
+
20
   private:
23
   private:
21
     static void callback(ImGuiTextEditCallbackData* data);
24
     static void callback(ImGuiTextEditCallbackData* data);
22
 
25
 
23
     const static int bufferLength = 256;
26
     const static int bufferLength = 256;
27
+
28
+    static bool visible;
24
     static char buffer[bufferLength + 1];
29
     static char buffer[bufferLength + 1];
25
-    static bool scrollToBottom;
26
-    static bool focusInput;
27
     static unsigned long lastLogLength;
30
     static unsigned long lastLogLength;
28
     static std::vector<std::string> lastCommands;
31
     static std::vector<std::string> lastCommands;
29
     static long lastCommandIndex;
32
     static long lastCommandIndex;

+ 3
- 3
include/UI.h Parādīt failu

17
 
17
 
18
 #include "system/Shader.h"
18
 #include "system/Shader.h"
19
 
19
 
20
-class ImDrawList;
20
+struct ImDrawList;
21
 
21
 
22
 class UI {
22
 class UI {
23
   public:
23
   public:
27
     static void shutdown();
27
     static void shutdown();
28
     static void setSize(glm::i32vec2 s);
28
     static void setSize(glm::i32vec2 s);
29
 
29
 
30
-    static void setVisible(bool v);
31
-    static bool isVisible();
30
+    static void setVisible(bool v) { visible = v; }
31
+    static bool isVisible() { return visible; }
32
 
32
 
33
     static void handleKeyboard(KeyboardButton key, bool pressed);
33
     static void handleKeyboard(KeyboardButton key, bool pressed);
34
     static void handleText(char* text, bool notFinished);
34
     static void handleText(char* text, bool notFinished);

+ 1
- 0
include/global.h Parādīt failu

27
 typedef enum {
27
 typedef enum {
28
     menuAction = 0,
28
     menuAction = 0,
29
     debugAction,
29
     debugAction,
30
+    consoleAction,
30
 
31
 
31
     forwardAction,
32
     forwardAction,
32
     backwardAction,
33
     backwardAction,

+ 7
- 3
src/Console.cpp Parādīt failu

15
 #include "commands/Command.h"
15
 #include "commands/Command.h"
16
 #include "Console.h"
16
 #include "Console.h"
17
 
17
 
18
+bool Console::visible = false;
18
 char Console::buffer[bufferLength + 1] = "";
19
 char Console::buffer[bufferLength + 1] = "";
19
-bool Console::scrollToBottom = false;
20
-bool Console::focusInput = false;
21
 unsigned long Console::lastLogLength = 0;
20
 unsigned long Console::lastLogLength = 0;
22
 std::vector<std::string> Console::lastCommands;
21
 std::vector<std::string> Console::lastCommands;
23
 long Console::lastCommandIndex = -1;
22
 long Console::lastCommandIndex = -1;
71
 }
70
 }
72
 
71
 
73
 void Console::display() {
72
 void Console::display() {
74
-    if (ImGui::Begin("Console", nullptr, ImVec2(600, 400))) {
73
+    if (!visible)
74
+        return;
75
+
76
+    static bool scrollToBottom = false;
77
+    if (ImGui::Begin("Console", &visible, ImVec2(600, 400))) {
75
         if (lastLogLength != getLog().size()) {
78
         if (lastLogLength != getLog().size()) {
76
             lastLogLength = getLog().size();
79
             lastLogLength = getLog().size();
77
             scrollToBottom = true;
80
             scrollToBottom = true;
87
         }
90
         }
88
         ImGui::EndChild();
91
         ImGui::EndChild();
89
 
92
 
93
+        bool focusInput = false;
90
         if (ImGui::InputText("Command", buffer, bufferLength,
94
         if (ImGui::InputText("Command", buffer, bufferLength,
91
                              ImGuiInputTextFlags_EnterReturnsTrue
95
                              ImGuiInputTextFlags_EnterReturnsTrue
92
                              | ImGuiInputTextFlags_CallbackCompletion
96
                              | ImGuiInputTextFlags_CallbackCompletion

+ 1
- 0
src/RunTime.cpp Parādīt failu

48
     // Default key bindings
48
     // Default key bindings
49
     keyBindings[menuAction] = escapeKey;
49
     keyBindings[menuAction] = escapeKey;
50
     keyBindings[debugAction] = qKey;
50
     keyBindings[debugAction] = qKey;
51
+    keyBindings[consoleAction] = backquoteKey;
51
     keyBindings[forwardAction] = wKey;
52
     keyBindings[forwardAction] = wKey;
52
     keyBindings[backwardAction] = sKey;
53
     keyBindings[backwardAction] = sKey;
53
     keyBindings[leftAction] = aKey;
54
     keyBindings[leftAction] = aKey;

+ 25
- 28
src/UI.cpp Parādīt failu

113
 
113
 
114
     ImGui::NewFrame();
114
     ImGui::NewFrame();
115
 
115
 
116
-    if (!visible) {
116
+    if (!(visible || Console::isVisible())) {
117
         while (!clickEvents.empty()) {
117
         while (!clickEvents.empty()) {
118
             auto i = clickEvents.front();
118
             auto i = clickEvents.front();
119
             if (getMenu().isVisible()) {
119
             if (getMenu().isVisible()) {
144
     while (!keyboardEvents.empty()) {
144
     while (!keyboardEvents.empty()) {
145
         auto i = keyboardEvents.front();
145
         auto i = keyboardEvents.front();
146
 
146
 
147
-        if (!visible) {
147
+        if (!(visible || Console::isVisible())) {
148
             if (getMenu().isVisible()) {
148
             if (getMenu().isVisible()) {
149
                 getMenu().handleKeyboard(std::get<0>(i), std::get<1>(i));
149
                 getMenu().handleKeyboard(std::get<0>(i), std::get<1>(i));
150
             } else {
150
             } else {
156
         }
156
         }
157
 
157
 
158
         if (std::get<1>(i)) {
158
         if (std::get<1>(i)) {
159
-            if (!visible) {
159
+            if (!(visible || Console::isVisible())) {
160
                 if (RunTime::getKeyBinding(menuAction) == std::get<0>(i)) {
160
                 if (RunTime::getKeyBinding(menuAction) == std::get<0>(i)) {
161
                     getMenu().setVisible(!getMenu().isVisible());
161
                     getMenu().setVisible(!getMenu().isVisible());
162
                 }
162
                 }
163
             }
163
             }
164
 
164
 
165
-            if ((!io.WantCaptureKeyboard) || (!visible)) {
166
-                if (RunTime::getKeyBinding(debugAction) == std::get<0>(i)) {
167
-                    if (!metaKeyIsActive)
165
+            if ((!io.WantCaptureKeyboard) || (!(visible || Console::isVisible()))) {
166
+                if (!metaKeyIsActive) {
167
+                    if (RunTime::getKeyBinding(debugAction) == std::get<0>(i)) {
168
                         visible = !visible;
168
                         visible = !visible;
169
+                    }
170
+
171
+                    if (RunTime::getKeyBinding(consoleAction) == std::get<0>(i)) {
172
+                        Console::setVisible(!Console::isVisible());
173
+                    }
169
                 }
174
                 }
170
             }
175
             }
171
         }
176
         }
174
     }
179
     }
175
 
180
 
176
     bool clicked = !clickEvents.empty();
181
     bool clicked = !clickEvents.empty();
177
-    // Only already empty when !visible
178
-    if (visible) {
179
-        clickEvents.clear();
180
-        motionEvents.clear();
181
-        scrollEvents.clear();
182
-    }
182
+    clickEvents.clear();
183
+    motionEvents.clear();
184
+    scrollEvents.clear();
183
 
185
 
184
-    if (visible && (
186
+    if ((visible || Console::isVisible()) && (
185
             ((!io.WantCaptureKeyboard) && io.KeysDown[escapeKey])
187
             ((!io.WantCaptureKeyboard) && io.KeysDown[escapeKey])
186
             || ((!io.WantCaptureMouse) && clicked)
188
             || ((!io.WantCaptureMouse) && clicked)
187
         )) {
189
         )) {
188
         visible = false;
190
         visible = false;
191
+        Console::setVisible(false);
189
     }
192
     }
190
 
193
 
191
-    if (Window::getTextInput() != visible)
192
-        Window::setTextInput(visible);
194
+    if (Window::getTextInput() != (visible || Console::isVisible()))
195
+        Window::setTextInput(visible || Console::isVisible());
193
 
196
 
194
-    bool input = !(visible || getMenu().isVisible());
197
+    bool input = !(visible || Console::isVisible() || getMenu().isVisible());
195
     if (Window::getMousegrab() != input)
198
     if (Window::getMousegrab() != input)
196
         Window::setMousegrab(input);
199
         Window::setMousegrab(input);
197
 
200
 
199
 }
202
 }
200
 
203
 
201
 void UI::display() {
204
 void UI::display() {
202
-    if (!visible)
203
-        return;
204
-
205
     Console::display();
205
     Console::display();
206
 
206
 
207
+    if (!visible) {
208
+        ImGui::Render();
209
+        return;
210
+    }
211
+
207
     static bool showTestWindow = false;
212
     static bool showTestWindow = false;
208
-    if (ImGui::Begin("Engine", nullptr, ImVec2(400, 400))) {
213
+    if (ImGui::Begin("Engine", &visible, ImVec2(400, 400))) {
209
         Render::displayUI();
214
         Render::displayUI();
210
         RunTime::display();
215
         RunTime::display();
211
         SoundManager::display();
216
         SoundManager::display();
514
     getGame().handleControllerButton(button, released);
519
     getGame().handleControllerButton(button, released);
515
 }
520
 }
516
 
521
 
517
-void UI::setVisible(bool v) {
518
-    visible = v;
519
-}
520
-
521
-bool UI::isVisible() {
522
-    return visible;
523
-}
524
-
525
 void UI::renderImGui(ImDrawList** const cmd_lists, int cmd_lists_count) {
522
 void UI::renderImGui(ImDrawList** const cmd_lists, int cmd_lists_count) {
526
     if (cmd_lists_count == 0)
523
     if (cmd_lists_count == 0)
527
         return;
524
         return;

+ 2
- 0
src/commands/CommandBind.cpp Parādīt failu

66
         return menuAction;
66
         return menuAction;
67
     } else if (action == "debug") {
67
     } else if (action == "debug") {
68
         return debugAction;
68
         return debugAction;
69
+    } else if (action == "console") {
70
+        return consoleAction;
69
     } else if (action == "forward") {
71
     } else if (action == "forward") {
70
         return forwardAction;
72
         return forwardAction;
71
     } else if (action == "backward") {
73
     } else if (action == "backward") {

+ 572
- 312
src/deps/imgui/imgui.cpp
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 22
- 14
src/deps/imgui/imgui.h Parādīt failu

1
-// ImGui library v1.19 wip
1
+// ImGui library v1.20
2
 // See .cpp file for commentary.
2
 // See .cpp file for commentary.
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.
19
 #include <stdarg.h>         // va_list
19
 #include <stdarg.h>         // va_list
20
 #include <stddef.h>         // ptrdiff_t
20
 #include <stddef.h>         // ptrdiff_t
21
 #include <stdlib.h>         // NULL, malloc
21
 #include <stdlib.h>         // NULL, malloc
22
+#include <string.h>         // memset, memmove
22
 
23
 
23
 #ifndef IM_ASSERT
24
 #ifndef IM_ASSERT
24
 #include <assert.h>
25
 #include <assert.h>
170
 
171
 
171
     IMGUI_API void          SetScrollPosHere();                                                 // adjust scrolling position to center into the current cursor position.
172
     IMGUI_API void          SetScrollPosHere();                                                 // adjust scrolling position to center into the current cursor position.
172
     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.
173
     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.
173
-    IMGUI_API void          SetTreeStateStorage(ImGuiStorage* tree);                            // replace tree state storage with our own (if you want to manipulate it yourself, typically clear subsection of it).
174
-    IMGUI_API ImGuiStorage* GetTreeStateStorage();
174
+    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).
175
+    IMGUI_API ImGuiStorage* GetStateStorage();
175
 
176
 
176
     IMGUI_API void          PushItemWidth(float item_width);                                    // width of items for the common item+label case. default to ~2/3 of windows width.
177
     IMGUI_API void          PushItemWidth(float item_width);                                    // width of items for the common item+label case. default to ~2/3 of windows width.
177
     IMGUI_API void          PopItemWidth();
178
     IMGUI_API void          PopItemWidth();
212
 
213
 
213
     // ID scopes
214
     // ID scopes
214
     // If you are creating repeated widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them.
215
     // If you are creating repeated widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them.
216
+    // You can also use ## within your widget name to distinguish them from each others (see 'Programmer Guide')
215
     IMGUI_API void          PushID(const char* str_id);                                         // push identifier into the ID stack. IDs are hash of the *entire* stack!
217
     IMGUI_API void          PushID(const char* str_id);                                         // push identifier into the ID stack. IDs are hash of the *entire* stack!
216
     IMGUI_API void          PushID(const void* ptr_id);
218
     IMGUI_API void          PushID(const void* ptr_id);
217
     IMGUI_API void          PushID(const int int_id);
219
     IMGUI_API void          PushID(const int int_id);
240
     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);
242
     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);
241
     IMGUI_API bool          SliderAngle(const char* label, float* v, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f);     // *v in radians
243
     IMGUI_API bool          SliderAngle(const char* label, float* v, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f);     // *v in radians
242
     IMGUI_API bool          SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f");
244
     IMGUI_API bool          SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f");
245
+    IMGUI_API bool          SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* display_format = "%.0f");
246
+    IMGUI_API bool          SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* display_format = "%.0f");
247
+    IMGUI_API bool          SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* display_format = "%.0f");
243
     IMGUI_API void          PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
248
     IMGUI_API void          PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
244
     IMGUI_API void          PlotLines(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0));
249
     IMGUI_API void          PlotLines(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0));
245
     IMGUI_API void          PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
250
     IMGUI_API void          PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
271
     IMGUI_API void          TreePop();
276
     IMGUI_API void          TreePop();
272
     IMGUI_API void          OpenNextNode(bool open);                                            // force open/close the next TreeNode or CollapsingHeader
277
     IMGUI_API void          OpenNextNode(bool open);                                            // force open/close the next TreeNode or CollapsingHeader
273
 
278
 
274
-    // Value helper output "name: value". tip: freely declare your own within the ImGui namespace!
279
+    // Value() Helpers: output single value in "name: value" format. Tip: freely declare your own within the ImGui namespace!
275
     IMGUI_API void          Value(const char* prefix, bool b);
280
     IMGUI_API void          Value(const char* prefix, bool b);
276
     IMGUI_API void          Value(const char* prefix, int v);
281
     IMGUI_API void          Value(const char* prefix, int v);
277
     IMGUI_API void          Value(const char* prefix, unsigned int v);
282
     IMGUI_API void          Value(const char* prefix, unsigned int v);
279
     IMGUI_API void          Color(const char* prefix, const ImVec4& v);
284
     IMGUI_API void          Color(const char* prefix, const ImVec4& v);
280
     IMGUI_API void          Color(const char* prefix, unsigned int v);
285
     IMGUI_API void          Color(const char* prefix, unsigned int v);
281
 
286
 
282
-    // Logging
283
-    IMGUI_API void          LogButtons();
284
-    IMGUI_API void          LogToTTY(int max_depth = -1);
285
-    IMGUI_API void          LogToFile(int max_depth = -1, const char* filename = NULL);
286
-    IMGUI_API void          LogToClipboard(int max_depth = -1);
287
+    // Logging: All text output from your interface are redirected to tty/file/clipboard. Tree nodes are automatically opened.
288
+    IMGUI_API void          LogToTTY(int max_depth = -1);                                       // start logging to tty
289
+    IMGUI_API void          LogToFile(int max_depth = -1, const char* filename = NULL);         // start logging to file
290
+    IMGUI_API void          LogToClipboard(int max_depth = -1);                                 // start logging to OS clipboard
291
+    IMGUI_API void          LogFinish();                                                        // stop logging (close file, etc.)
292
+    IMGUI_API void          LogButtons();                                                       // helper to display buttons for logging to tty/file/clipboard
293
+    IMGUI_API void          LogText(const char* fmt, ...);                                      // pass text data straight to log (without being displayed)
287
 
294
 
288
     // Utilities
295
     // Utilities
289
     IMGUI_API bool          IsItemHovered();                                                    // was the last item active area hovered by mouse?
296
     IMGUI_API bool          IsItemHovered();                                                    // was the last item active area hovered by mouse?
301
     IMGUI_API ImVec2        GetMousePos();                                                      // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
308
     IMGUI_API ImVec2        GetMousePos();                                                      // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
302
     IMGUI_API float         GetTime();
309
     IMGUI_API float         GetTime();
303
     IMGUI_API int           GetFrameCount();
310
     IMGUI_API int           GetFrameCount();
304
-    IMGUI_API const char*   GetStyleColorName(ImGuiCol idx);
311
+    IMGUI_API const char*   GetStyleColName(ImGuiCol idx);
305
     IMGUI_API void          GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size);
312
     IMGUI_API void          GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size);
306
     IMGUI_API ImVec2        CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
313
     IMGUI_API ImVec2        CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
307
 
314
 
380
     ImGuiCol_ComboBg,
387
     ImGuiCol_ComboBg,
381
     ImGuiCol_CheckHovered,
388
     ImGuiCol_CheckHovered,
382
     ImGuiCol_CheckActive,
389
     ImGuiCol_CheckActive,
390
+    ImGuiCol_CheckMark,
383
     ImGuiCol_SliderGrab,
391
     ImGuiCol_SliderGrab,
384
     ImGuiCol_SliderGrabActive,
392
     ImGuiCol_SliderGrabActive,
385
     ImGuiCol_Button,
393
     ImGuiCol_Button,
417
     ImGuiStyleVar_ItemSpacing,       // ImVec2
425
     ImGuiStyleVar_ItemSpacing,       // ImVec2
418
     ImGuiStyleVar_ItemInnerSpacing,  // ImVec2
426
     ImGuiStyleVar_ItemInnerSpacing,  // ImVec2
419
     ImGuiStyleVar_TreeNodeSpacing,   // float
427
     ImGuiStyleVar_TreeNodeSpacing,   // float
420
-    ImGuiStyleVar_ColumnsMinSpacing  // float 
421
 };
428
 };
422
 
429
 
423
 // Enumeration for ColorEditMode()
430
 // Enumeration for ColorEditMode()
443
     float       Alpha;                      // Global alpha applies to everything in ImGui
450
     float       Alpha;                      // Global alpha applies to everything in ImGui
444
     ImVec2      WindowPadding;              // Padding within a window
451
     ImVec2      WindowPadding;              // Padding within a window
445
     ImVec2      WindowMinSize;              // Minimum window size
452
     ImVec2      WindowMinSize;              // Minimum window size
453
+    float       WindowRounding;             // Radius of window corners rounding. Set to 0.0f to have rectangular windows
446
     ImVec2      FramePadding;               // Padding within a framed rectangle (used by most widgets)
454
     ImVec2      FramePadding;               // Padding within a framed rectangle (used by most widgets)
447
     ImVec2      ItemSpacing;                // Horizontal and vertical spacing between widgets/lines
455
     ImVec2      ItemSpacing;                // Horizontal and vertical spacing between widgets/lines
448
     ImVec2      ItemInnerSpacing;           // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
456
     ImVec2      ItemInnerSpacing;           // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
449
     ImVec2      TouchExtraPadding;          // Expand bounding box for touch-based system where touch position is not accurate enough (unnecessary for mouse inputs). Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget running. So dont grow this too much!
457
     ImVec2      TouchExtraPadding;          // Expand bounding box for touch-based system where touch position is not accurate enough (unnecessary for mouse inputs). Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget running. So dont grow this too much!
450
     ImVec2      AutoFitPadding;             // Extra space after auto-fit (double-clicking on resize grip)
458
     ImVec2      AutoFitPadding;             // Extra space after auto-fit (double-clicking on resize grip)
451
     float       WindowFillAlphaDefault;     // Default alpha of window background, if not specified in ImGui::Begin()
459
     float       WindowFillAlphaDefault;     // Default alpha of window background, if not specified in ImGui::Begin()
452
-    float       WindowRounding;             // Radius of window corners rounding. Set to 0.0f to have rectangular windows
453
     float       TreeNodeSpacing;            // Horizontal spacing when entering a tree node
460
     float       TreeNodeSpacing;            // Horizontal spacing when entering a tree node
454
     float       ColumnsMinSpacing;          // Minimum horizontal spacing between two columns
461
     float       ColumnsMinSpacing;          // Minimum horizontal spacing between two columns
455
     float       ScrollBarWidth;             // Width of the vertical scroll bar
462
     float       ScrollBarWidth;             // Width of the vertical scroll bar
604
     bool                empty() { return Buf.empty(); }
611
     bool                empty() { return Buf.empty(); }
605
     void                clear() { Buf.clear(); Buf.push_back(0); }
612
     void                clear() { Buf.clear(); Buf.push_back(0); }
606
     IMGUI_API void      append(const char* fmt, ...);
613
     IMGUI_API void      append(const char* fmt, ...);
614
+    IMGUI_API void      appendv(const char* fmt, va_list args);
607
 };
615
 };
608
 
616
 
609
 // Helper: Key->value storage
617
 // Helper: Key->value storage
679
     ImU32   col;
687
     ImU32   col;
680
 };
688
 };
681
 #else
689
 #else
682
-// You can change the vertex format layout by defining IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT.
690
+// You can change the vertex format layout by defining IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT in imconfig.h
683
 // The code expect ImVec2 pos (8 bytes), ImVec2 uv (8 bytes), ImU32 col (4 bytes), but you can re-order them or add other fields as needed to simplify integration in your engine.
691
 // The code expect ImVec2 pos (8 bytes), ImVec2 uv (8 bytes), ImU32 col (4 bytes), but you can re-order them or add other fields as needed to simplify integration in your engine.
684
 // The type has to be described by the #define (you can either declare the struct or use a typedef)
692
 // The type has to be described by the #define (you can either declare the struct or use a typedef)
685
 IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT;
693
 IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT;
737
 
745
 
738
     // Settings
746
     // Settings
739
     float                       Scale;              // = 1.0f          // Base font scale, multiplied by the per-window font scale which you can adjust with SetFontScale()
747
     float                       Scale;              // = 1.0f          // Base font scale, multiplied by the per-window font scale which you can adjust with SetFontScale()
740
-    ImVec2                      DisplayOffset;      // = (0.0f,0.0f    // Offset font rendering by xx pixels
748
+    ImVec2                      DisplayOffset;      // = (0.0f,0.0f)   // Offset font rendering by xx pixels
741
     ImVec2                      TexUvForWhite;      // = (0.0f,0.0f)   // Font texture must have a white pixel at this UV coordinate. Adjust if you are using custom texture.
749
     ImVec2                      TexUvForWhite;      // = (0.0f,0.0f)   // Font texture must have a white pixel at this UV coordinate. Adjust if you are using custom texture.
742
     ImWchar                     FallbackChar;       // = '?'           // Replacement glyph is one isn't found.
750
     ImWchar                     FallbackChar;       // = '?'           // Replacement glyph is one isn't found.
743
 
751
 

Notiek ielāde…
Atcelt
Saglabāt