Thomas Buck 9 роки тому
джерело
коміт
82fd42a93f
5 змінених файлів з 650 додано та 229 видалено
  1. 6
    0
      ChangeLog.md
  2. 2
    0
      TODO.md
  3. 7
    6
      src/deps/imgui/imconfig.h
  4. 556
    177
      src/deps/imgui/imgui.cpp
  5. 79
    46
      src/deps/imgui/imgui.h

+ 6
- 0
ChangeLog.md Переглянути файл

@@ -2,6 +2,12 @@
2 2
 
3 3
 ## OpenRaider (0.1.3) xythobuz <xythobuz@xythobuz.de>
4 4
 
5
+    [ 20140930 ]
6
+    * Updated imgui to version 1.13
7
+
8
+    [ 20140920 ]
9
+    * Updated imgui (fix for resource leak)
10
+
5 11
     [ 20140909 ]
6 12
     * utils/time now using std::chrono (C++11) for single cross-plattform implementation
7 13
     * Updated imgui (my pull request was merged)

+ 2
- 0
TODO.md Переглянути файл

@@ -1,5 +1,7 @@
1 1
 # To-Do List
2 2
 
3
+* Console no longer has command history (arrow up, down)
4
+
3 5
 ## General
4 6
 
5 7
 * Move to newer OpenGL (GL ES or 2.1 or 3.x or 4.x?)

+ 7
- 6
src/deps/imgui/imconfig.h Переглянути файл

@@ -1,14 +1,11 @@
1 1
 //-----------------------------------------------------------------------------
2 2
 // USER IMPLEMENTATION
3
+// This file contains compile-time options for ImGui.
4
+// Other options (memory allocation overrides, callbacks, etc.) can be set at runtime via the ImGuiIO structure - ImGui::GetIO().
3 5
 //-----------------------------------------------------------------------------
4 6
 
5 7
 #pragma once
6 8
 
7
-//---- Define your own malloc/free/realloc functions if you want to override internal memory allocations for ImGui
8
-//#define IM_MALLOC(_SIZE)			MyMalloc(_SIZE)			// void* MyMalloc(size_t size);
9
-//#define IM_FREE(_PTR)				MyFree(_PTR)			// void MyFree(void *ptr);
10
-//#define IM_REALLOC(_PTR, _SIZE)	MyRealloc(_PTR, _SIZE)	// void* MyRealloc(void *ptr, size_t size);
11
-
12 9
 //---- Define your own ImVector<> type if you don't want to use the provided implementation defined in imgui.h
13 10
 //#include <vector>
14 11
 //#define ImVector  std::vector
@@ -17,9 +14,12 @@
17 14
 //---- Define assertion handler. Defaults to calling assert().
18 15
 //#define IM_ASSERT(_EXPR)  MyAssert(_EXPR)
19 16
 
20
-//---- Don't implement default clipboard handlers for Windows (so as not to link with OpenClipboard(), etc.)
17
+//---- Don't implement default clipboard handlers for Windows (so as not to link with OpenClipboard() and others Win32 functions)
21 18
 //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS
22 19
 
20
+//---- Include imgui_user.cpp at the end of imgui.cpp so you can include code that extends ImGui using its private data/functions.
21
+//#define IMGUI_INCLUDE_IMGUI_USER_CPP
22
+
23 23
 //---- Define implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4.
24 24
 /*
25 25
 #define IM_VEC2_CLASS_EXTRA                                                 \
@@ -32,6 +32,7 @@
32 32
 */
33 33
 
34 34
 //---- Freely implement extra functions within the ImGui:: namespace.
35
+//---- Declare helpers or widgets implemented in imgui_user.cpp or elsewhere, so end-user doesn't need to include multiple files.
35 36
 //---- e.g. you can create variants of the ImGui::Value() helper for your low-level math types.
36 37
 /*
37 38
 namespace ImGui

+ 556
- 177
src/deps/imgui/imgui.cpp
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 79
- 46
src/deps/imgui/imgui.h Переглянути файл

@@ -1,4 +1,4 @@
1
-// ImGui library
1
+// ImGui library v1.13
2 2
 // See .cpp file for commentary.
3 3
 // See ImGui::ShowTestWindow() for sample code.
4 4
 // Read 'Programmer guide' in .cpp for notes on how to setup ImGui in your codebase.
@@ -17,26 +17,16 @@ struct ImGuiWindow;
17 17
 #include "imconfig.h"
18 18
 #include <float.h>          // FLT_MAX
19 19
 #include <stdarg.h>         // va_list
20
+#include <stddef.h>         // ptrdiff_t
20 21
 #include <stdlib.h>         // NULL, malloc
21 22
 
22
-#ifndef IM_MALLOC
23
-#define IM_MALLOC(_SIZE) malloc((_SIZE))
24
-#endif
25
-
26
-#ifndef IM_FREE
27
-#define IM_FREE(_PTR) free((_PTR))
28
-#endif
29
-
30
-#ifndef IM_REALLOC
31
-#define IM_REALLOC(_PTR, _SIZE) realloc((_PTR), (_SIZE))
32
-#endif
33
-
34 23
 #ifndef IM_ASSERT
35 24
 #include <assert.h>
36 25
 #define IM_ASSERT(_EXPR)    assert(_EXPR)
37 26
 #endif
38 27
 
39 28
 typedef unsigned int ImU32;
29
+typedef unsigned short ImWchar;
40 30
 typedef ImU32 ImGuiID;
41 31
 typedef int ImGuiCol;               // enum ImGuiCol_
42 32
 typedef int ImGuiKey;               // enum ImGuiKey_
@@ -67,8 +57,17 @@ struct ImVec4
67 57
 #endif
68 58
 };
69 59
 
60
+namespace ImGui
61
+{
62
+    // Proxy functions to access the MemAllocFn/MemFreeFn/MemReallocFn pointers in ImGui::GetIO(). The only reason they exist here is to allow ImVector<> to compile inline.
63
+    void*       MemAlloc(size_t sz);
64
+    void        MemFree(void* ptr);
65
+    void*       MemRealloc(void* ptr, size_t sz);
66
+};
67
+
70 68
 // std::vector<> like class to avoid dragging dependencies (also: windows implementation of STL with debug enabled is absurdly slow, so let's bypass it so our code runs fast in debug). 
71
-// this implementation does NOT call c++ constructors! we don't need them! also only provide the minimum functionalities we need.
69
+// Use '#define ImVector std::vector' if you want to use the STL type or your own type.
70
+// Our implementation does NOT call c++ constructors! because the data types we use don't need them (but that could be added as well). Only provide the minimum functionalities we need.
72 71
 #ifndef ImVector
73 72
 template<typename T>
74 73
 class ImVector
@@ -84,7 +83,7 @@ public:
84 83
     typedef const value_type*   const_iterator;
85 84
 
86 85
     ImVector()                  { Size = Capacity = 0; Data = NULL; }
87
-    ~ImVector()                 { if (Data) IM_FREE(Data); }
86
+    ~ImVector()                 { if (Data) ImGui::MemFree(Data); }
88 87
 
89 88
     inline bool                 empty() const                   { return Size == 0; }
90 89
     inline size_t               size() const                    { return Size; }
@@ -95,7 +94,7 @@ public:
95 94
     inline value_type&          operator[](size_t i)            { IM_ASSERT(i < Size); return Data[i]; }
96 95
     inline const value_type&    operator[](size_t i) const      { IM_ASSERT(i < Size); return Data[i]; }
97 96
 
98
-    inline void                 clear()                         { if (Data) { Size = Capacity = 0; IM_FREE(Data); Data = NULL; } }
97
+    inline void                 clear()                         { if (Data) { Size = Capacity = 0; ImGui::MemFree(Data); Data = NULL; } }
99 98
     inline iterator             begin()                         { return Data; }
100 99
     inline const_iterator       begin() const                   { return Data; }
101 100
     inline iterator             end()                           { return Data + Size; }
@@ -106,14 +105,14 @@ public:
106 105
     inline const value_type&    back() const                    { IM_ASSERT(Size > 0); return at(Size-1); }
107 106
     inline void                 swap(ImVector<T>& rhs)          { const size_t rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; const size_t rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
108 107
 
109
-    inline void                 reserve(size_t new_capacity)    { Data = (value_type*)IM_REALLOC(Data, new_capacity * sizeof(value_type)); Capacity = new_capacity; }
108
+    inline void                 reserve(size_t new_capacity)    { Data = (value_type*)ImGui::MemRealloc(Data, new_capacity * sizeof(value_type)); Capacity = new_capacity; }
110 109
     inline void                 resize(size_t new_size)         { if (new_size > Capacity) reserve(new_size); Size = new_size; }
111 110
 
112 111
     inline void                 push_back(const value_type& v)  { if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); Data[Size++] = v; }
113 112
     inline void                 pop_back()                      { IM_ASSERT(Size > 0); Size--; }
114 113
 
115
-    inline iterator             erase(const_iterator it)        { IM_ASSERT(it >= begin() && it < end()); const int off = it - begin(); memmove(Data + off, Data + off + 1, (Size - off - 1) * sizeof(value_type)); Size--; return Data + off; }
116
-    inline void                 insert(const_iterator it, const value_type& v)  { IM_ASSERT(it >= begin() && it <= end()); const int off = it - begin(); if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); if (off < (int)Size) memmove(Data + off + 1, Data + off, (Size - off) * sizeof(value_type)); Data[off] = v; Size++; }
114
+    inline iterator             erase(const_iterator it)        { IM_ASSERT(it >= begin() && it < end()); const ptrdiff_t off = it - begin(); memmove(Data + off, Data + off + 1, (Size - off - 1) * sizeof(value_type)); Size--; return Data + off; }
115
+    inline void                 insert(const_iterator it, const value_type& v)  { IM_ASSERT(it >= begin() && it <= end()); const ptrdiff_t off = it - begin(); if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); if (off < (int)Size) memmove(Data + off + 1, Data + off, (Size - off) * sizeof(value_type)); Data[off] = v; Size++; }
117 116
 };
118 117
 #endif // #ifndef ImVector
119 118
 
@@ -152,7 +151,7 @@ namespace ImGui
152 151
     ImVec2      GetWindowContentRegionMin();
153 152
     ImVec2      GetWindowContentRegionMax();
154 153
     ImDrawList* GetWindowDrawList();                                                // get rendering command-list if you want to append your own draw primitives.
155
-    void        SetFontScale(float scale);
154
+    void        SetWindowFontScale(float scale);                                    // per-window font scale. Adjust IO.FontBaseScale if you want to scale all windows together.
156 155
     void        SetScrollPosHere();                                                 // adjust scrolling position to center into the current cursor position.
157 156
     void        SetTreeStateStorage(ImGuiStorage* tree);                            // replace tree state storage with our own (if you want to manipulate it yourself, typically clear subsection of it).
158 157
     ImGuiStorage* GetTreeStateStorage();
@@ -166,6 +165,7 @@ namespace ImGui
166 165
 
167 166
     // Tooltip
168 167
     void        SetTooltip(const char* fmt, ...);                                   // set tooltip under mouse-cursor, typically use with ImGui::IsHovered(). last call wins.
168
+    void        SetTooltipV(const char* fmt, va_list args);
169 169
     void        BeginTooltip();                                                     // use to create full-featured tooltip windows that aren't just text.
170 170
     void        EndTooltip();
171 171
 
@@ -178,11 +178,11 @@ namespace ImGui
178 178
     float       GetColumnOffset(int column_index = -1);
179 179
     void        SetColumnOffset(int column_index, float offset);
180 180
     float       GetColumnWidth(int column_index = -1);
181
-    ImVec2      GetCursorPos();                                                     // cursor position relative to window position
181
+    ImVec2      GetCursorPos();                                                     // cursor position is relative to window position
182 182
     void        SetCursorPos(const ImVec2& pos);                                    // "
183 183
     void        SetCursorPosX(float x);                                             // "
184 184
     void        SetCursorPosY(float y);                                             // "
185
-    ImVec2      GetCursorScreenPos();												// cursor position in screen space
185
+    ImVec2      GetCursorScreenPos();                                               // cursor position in screen space
186 186
     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.
187 187
     float       GetTextLineSpacing();
188 188
     float       GetTextLineHeight();
@@ -197,16 +197,19 @@ namespace ImGui
197 197
     void        Text(const char* fmt, ...);
198 198
     void        TextV(const char* fmt, va_list args);
199 199
     void        TextColored(const ImVec4& col, const char* fmt, ...);               // shortcut to doing PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
200
+    void        TextColoredV(const ImVec4& col, const char* fmt, va_list args);
200 201
     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, better for long chunks of text.
201 202
     void        LabelText(const char* label, const char* fmt, ...);
203
+    void        LabelTextV(const char* label, const char* fmt, va_list args);
202 204
     void        BulletText(const char* fmt, ...);
205
+    void        BulletTextV(const char* fmt, va_list args);
203 206
     bool        Button(const char* label, ImVec2 size = ImVec2(0,0), bool repeat_when_held = false);
204 207
     bool        SmallButton(const char* label);
205 208
     bool        CollapsingHeader(const char* label, const char* str_id = NULL, const bool display_frame = true, const bool default_open = false);
206 209
     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.
207 210
     bool        SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
208 211
     bool        SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
209
-    bool        SliderFloat4(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
212
+    bool        SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
210 213
     bool        SliderAngle(const char* label, float* v, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f);     // *v in radians
211 214
     bool        SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f");
212 215
     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));
@@ -231,6 +234,8 @@ namespace ImGui
231 234
     bool        TreeNode(const char* str_label_id);                                 // if returning 'true' the node is open and the user is responsible for calling TreePop
232 235
     bool        TreeNode(const char* str_id, const char* fmt, ...);                 // "
233 236
     bool        TreeNode(const void* ptr_id, const char* fmt, ...);                 // "
237
+    bool        TreeNodeV(const char* str_id, const char* fmt, va_list args);       // "
238
+    bool        TreeNodeV(const void* ptr_id, const char* fmt, va_list args);       // "
234 239
     void        TreePush(const char* str_id = NULL);                                // already called by TreeNode(), but you can call Push/Pop yourself for layouting purpose
235 240
     void        TreePush(const void* ptr_id = NULL);                                // "
236 241
     void        TreePop();
@@ -260,8 +265,11 @@ namespace ImGui
260 265
     bool        IsKeyPressed(int key_index, bool repeat = true);                    // key_index into the keys_down[512] array, imgui doesn't know the semantic of each entry
261 266
     bool        IsMouseClicked(int button, bool repeat = false);
262 267
     bool        IsMouseDoubleClicked(int button);
263
-    bool        IsMouseHoveringBox(const ImVec2& box_min, const ImVec2& box_max);
264
-    ImVec2      GetMousePos();
268
+    bool        IsMouseHoveringWindow();                                            // is mouse hovering current window ("window" in API names always refer to current window)
269
+    bool        IsMouseHoveringAnyWindow();                                         // is mouse hovering any active imgui window
270
+    bool        IsMouseHoveringBox(const ImVec2& box_min, const ImVec2& box_max);   // is mouse hovering given bounding box
271
+    bool        IsPosHoveringAnyWindow(const ImVec2& pos);                          // is given position hovering any active imgui window
272
+    ImVec2      GetMousePos();                                                      // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
265 273
     float       GetTime();
266 274
     int         GetFrameCount();
267 275
     const char* GetStyleColorName(ImGuiCol idx);
@@ -394,7 +402,10 @@ struct ImGuiStyle
394 402
 // Read 'Programmer guide' section in .cpp file for general usage.
395 403
 struct ImGuiIO
396 404
 {
405
+    //------------------------------------------------------------------
397 406
     // Settings (fill once)                 // Default value:
407
+    //------------------------------------------------------------------
408
+
398 409
     ImVec2      DisplaySize;                // <unset>                  // Display size, in pixels. For clamping windows positions.
399 410
     float       DeltaTime;                  // = 1.0f/60.0f             // Time elapsed since last frame, in seconds.
400 411
     float       IniSavingRate;              // = 5.0f                   // Maximum time between saving .ini file, in seconds. Set to a negative value to disable .ini saving.
@@ -404,39 +415,60 @@ struct ImGuiIO
404 415
     float       MouseDoubleClickMaxDist;    // = 6.0f                   // Distance threshold to stay in to validate a double-click, in pixels.
405 416
     int         KeyMap[ImGuiKey_COUNT];     // <unset>                  // Map of indices into the KeysDown[512] entries array
406 417
     ImFont      Font;                       // <auto>                   // Gets passed to text functions. Typedef ImFont to the type you want (ImBitmapFont* or your own font).
407
-	float		FontYOffset;				// = 0.0f					// Offset font rendering by xx pixels in Y axis.
418
+    float       FontYOffset;                // = 0.0f                   // Offset font rendering by xx pixels in Y axis.
408 419
     ImVec2      FontTexUvForWhite;          // = (0.0f,0.0f)            // Font texture must have a white pixel at this UV coordinate. Adjust if you are using custom texture.
409
-    bool        FontAllowScaling;           // = false                  // Set to allow scaling text with CTRL+Wheel.
420
+    float       FontBaseScale;              // = 1.0f                   // Base font scale, multiplied by the per-window font scale which you can adjust with SetFontScale()
421
+    bool        FontAllowUserScaling;       // = false                  // Set to allow scaling text with CTRL+Wheel.
422
+	ImWchar     FontFallbackGlyph;          // = '?'                    // Replacement glyph is one isn't found.
410 423
     float       PixelCenterOffset;          // = 0.0f                   // Try to set to 0.5f or 0.375f if rendering is blurry
411 424
 
412
-    // Settings - Rendering function (REQUIRED)
425
+    //------------------------------------------------------------------
426
+    // User Functions
427
+    //------------------------------------------------------------------
428
+
429
+    // REQUIRED: rendering function. 
413 430
     // See example code if you are unsure of how to implement this.
414
-    void        (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);
431
+    void        (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);      
432
+
433
+    // Optional: access OS clipboard (default to use native Win32 clipboard on Windows, otherwise use a ImGui private clipboard)
434
+    // Override to access OS clipboard on other architectures.
435
+    const char* (*GetClipboardTextFn)();
436
+    void        (*SetClipboardTextFn)(const char* text);
415 437
 
416
-    // Settings - Clipboard Support
417
-    // Override to provide your clipboard handlers.
418
-    // On Windows architecture, defaults to use the native Win32 clipboard, otherwise default to use a ImGui private clipboard. 
419
-    // NB- for SetClipboardTextFn, the string is *NOT* zero-terminated at 'text_end'
420
-    const char* (*GetClipboardTextFn)();                                        
421
-    void        (*SetClipboardTextFn)(const char* text, const char* text_end);
438
+    // Optional: override memory allocations (default to posix malloc/realloc/free)
439
+    void*       (*MemAllocFn)(size_t sz);
440
+    void*       (*MemReallocFn)(void* ptr, size_t sz);
441
+    void        (*MemFreeFn)(void* ptr);
422 442
 
443
+    // Optional: notify OS Input Method Editor of text input position (e.g. when using Japanese/Chinese inputs, otherwise this isn't needed)
444
+    void        (*ImeSetInputScreenPosFn)(int x, int y);
445
+
446
+    //------------------------------------------------------------------
423 447
     // Input - Fill before calling NewFrame()
448
+    //------------------------------------------------------------------
449
+
424 450
     ImVec2      MousePos;                   // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
425 451
     bool        MouseDown[5];               // Mouse buttons. ImGui itself only uses button 0 (left button) but you can use others as storage for convenience.
426 452
     int         MouseWheel;                 // Mouse wheel: -1,0,+1
427 453
     bool        KeyCtrl;                    // Keyboard modifier pressed: Control
428 454
     bool        KeyShift;                   // Keyboard modifier pressed: Shift
429 455
     bool        KeysDown[512];              // Keyboard keys that are pressed (in whatever order user naturally has access to keyboard data)
430
-    char        InputCharacters[16];        // List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper.
456
+    ImWchar     InputCharacters[16];        // List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper.
431 457
 
458
+    // Function
459
+    void        AddInputCharacter(ImWchar); // Helper to add a new character into InputCharacters[]
460
+
461
+    //------------------------------------------------------------------
432 462
     // Output - Retrieve after calling NewFrame(), you can use them to discard inputs or hide them from the rest of your application
433
-    bool        WantCaptureMouse;           // ImGui is using your mouse input (= window is being hovered or widget is active).
434
-    bool        WantCaptureKeyboard;        // imGui is using your keyboard input (= widget is active).
463
+    //------------------------------------------------------------------
435 464
 
436
-    // Function
437
-    void        AddInputCharacter(char c);  // Helper to add a new character into InputCharacters[]
465
+    bool        WantCaptureMouse;           // Mouse is hovering a window or widget is active (= ImGui will use your mouse input)
466
+    bool        WantCaptureKeyboard;        // Widget is active (= ImGui will use your keyboard input)
438 467
 
468
+    //------------------------------------------------------------------
439 469
     // [Internal] ImGui will maintain those fields for you
470
+    //------------------------------------------------------------------
471
+
440 472
     ImVec2      MousePosPrev;
441 473
     ImVec2      MouseDelta;
442 474
     bool        MouseClicked[5];
@@ -468,9 +500,9 @@ private:
468 500
 // Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
469 501
 struct ImGuiTextFilter
470 502
 {
471
-    struct TextRange 
472
-    { 
473
-        const char* b; 
503
+    struct TextRange
504
+    {
505
+        const char* b;
474 506
         const char* e;
475 507
 
476 508
         TextRange() { b = e = NULL; }
@@ -479,7 +511,7 @@ struct ImGuiTextFilter
479 511
         const char* end() const { return e; }
480 512
         bool empty() const { return b == e; }
481 513
         char front() const { return *b; }
482
-        static bool isblank(char c) { return c == ' ' || c == '\t'; } 
514
+        static bool isblank(char c) { return c == ' ' || c == '\t'; }
483 515
         void trim_blanks() { while (b < e && isblank(*b)) b++; while (e > b && isblank(*(e-1))) e--; }
484 516
         void split(char separator, ImVector<TextRange>& out);
485 517
     };
@@ -655,8 +687,9 @@ struct ImBitmapFont
655 687
     void                    BuildLookupTable();
656 688
     const FntGlyph *        FindGlyph(unsigned short c) const;
657 689
     float                   GetFontSize() const { return (float)Info->FontSize; }
658
-	bool					IsLoaded() const { return Info != NULL && Common != NULL && Glyphs != NULL; }
690
+    bool                    IsLoaded() const { return Info != NULL && Common != NULL && Glyphs != NULL; }
659 691
 
660
-    ImVec2                  CalcTextSize(float size, float max_width, const char* text_begin, const char* text_end, const char** remaining = NULL) const;
692
+    ImVec2                  CalcTextSizeA(float size, float max_width, const char* text_begin, const char* text_end, const char** remaining = NULL) const;            // utf8
693
+    ImVec2                  CalcTextSizeW(float size, float max_width, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL) const;  // wchar
661 694
     void                    RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices) const;
662 695
 };

Завантаження…
Відмінити
Зберегти