mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-04 07:01:04 +01:00 
			
		
		
		
	Merge branch 'master_164' into viewport_164
# Conflicts: # imgui.cpp # imgui_draw.cpp # imgui_widgets.cpp
This commit is contained in:
		@@ -30,12 +30,12 @@ HOW TO UPDATE?
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-----------------------------------------------------------------------
 | 
			
		||||
 VERSION 1.64 (in progress)
 | 
			
		||||
 VERSION 1.64 (Released 2018-08-31)
 | 
			
		||||
-----------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Changes:
 | 
			
		||||
 | 
			
		||||
- Moved Readme, Changelog and Todo files to the docs/ folder.
 | 
			
		||||
- Moved README, CHANGELOG and TODO files to the docs/ folder.
 | 
			
		||||
  If you are updating dear imgui by copying files, take the chance to delete the old files.
 | 
			
		||||
- Added imgui_widgets.cpp file, extracted and moved widgets code out of imgui.cpp into imgui_widgets.cpp.
 | 
			
		||||
  Re-ordered some of the code remaining in imgui.cpp in cleared chunks.
 | 
			
		||||
@@ -44,7 +44,9 @@ Changes:
 | 
			
		||||
  If you have any modifications to imgui.cpp, it is suggested that you first update to 1.63, then
 | 
			
		||||
  isolate your patches. You can peak at imgui_widgets.cpp from 1.64 to get a sense of what is included in it,
 | 
			
		||||
  then separate your changes into several patches that can more easily be applied to 1.64 on a per-file basis.
 | 
			
		||||
- As a reminder, if you have any change to imgui.cpp it is a good habit to discuss them on the github
 | 
			
		||||
  What I found worked nicely for me, was to open the diff of the old patches in an interactive merge/diff tool,
 | 
			
		||||
  search for the corresponding function in the new code and apply the chunks manually. 
 | 
			
		||||
- As a reminder, if you have any change to imgui.cpp it is a good habit to discuss them on the github,
 | 
			
		||||
  so a solution applicable on the Master branch can be found. If your company has changes that you cannot
 | 
			
		||||
  disclose you may also contact me privately.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										111
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										111
									
								
								imgui.cpp
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
// dear imgui, v1.64 WIP
 | 
			
		||||
// dear imgui, v1.64
 | 
			
		||||
// (main code and documentation)
 | 
			
		||||
 | 
			
		||||
// Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code.
 | 
			
		||||
@@ -19,32 +19,58 @@
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
 Index
 | 
			
		||||
 - MISSION STATEMENT
 | 
			
		||||
 - END-USER GUIDE
 | 
			
		||||
 - PROGRAMMER GUIDE (read me!)
 | 
			
		||||
   - Read first
 | 
			
		||||
   - How to update to a newer version of Dear ImGui
 | 
			
		||||
   - Getting started with integrating Dear ImGui in your code/engine
 | 
			
		||||
   - Using gamepad/keyboard navigation controls [BETA]
 | 
			
		||||
 - API BREAKING CHANGES (read me when you update!)
 | 
			
		||||
 - ISSUES & TODO LIST
 | 
			
		||||
 - FREQUENTLY ASKED QUESTIONS (FAQ), TIPS
 | 
			
		||||
   - How can I tell whether to dispatch mouse/keyboard to imgui or to my application?
 | 
			
		||||
   - How can I display an image? What is ImTextureID, how does it works?
 | 
			
		||||
   - How can I have multiple widgets with the same label or without a label? A primer on labels and the ID Stack.
 | 
			
		||||
   - How can I use my own math types instead of ImVec2/ImVec4? 
 | 
			
		||||
   - How can I load a different font than the default?
 | 
			
		||||
   - How can I easily use icons in my application?
 | 
			
		||||
   - How can I load multiple fonts?
 | 
			
		||||
   - How can I display and input non-latin characters such as Chinese, Japanese, Korean, Cyrillic?
 | 
			
		||||
   - How can I use the drawing facilities without an ImGui window? (using ImDrawList API)
 | 
			
		||||
   - I integrated Dear ImGui in my engine and the text or lines are blurry..
 | 
			
		||||
   - I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around..
 | 
			
		||||
   - How can I help?
 | 
			
		||||
 - ISSUES & TODO-LIST
 | 
			
		||||
 - CODE
 | 
			
		||||
Index of this file:
 | 
			
		||||
 | 
			
		||||
DOCUMENTATION
 | 
			
		||||
- MISSION STATEMENT
 | 
			
		||||
- END-USER GUIDE
 | 
			
		||||
- PROGRAMMER GUIDE (read me!)
 | 
			
		||||
  - Read first
 | 
			
		||||
  - How to update to a newer version of Dear ImGui
 | 
			
		||||
  - Getting started with integrating Dear ImGui in your code/engine
 | 
			
		||||
  - Using gamepad/keyboard navigation controls [BETA]
 | 
			
		||||
- API BREAKING CHANGES (read me when you update!)
 | 
			
		||||
- FREQUENTLY ASKED QUESTIONS (FAQ), TIPS
 | 
			
		||||
  - How can I tell whether to dispatch mouse/keyboard to imgui or to my application?
 | 
			
		||||
  - How can I display an image? What is ImTextureID, how does it works?
 | 
			
		||||
  - How can I have multiple widgets with the same label or without a label? A primer on labels and the ID Stack.
 | 
			
		||||
  - How can I use my own math types instead of ImVec2/ImVec4? 
 | 
			
		||||
  - How can I load a different font than the default?
 | 
			
		||||
  - How can I easily use icons in my application?
 | 
			
		||||
  - How can I load multiple fonts?
 | 
			
		||||
  - How can I display and input non-latin characters such as Chinese, Japanese, Korean, Cyrillic?
 | 
			
		||||
  - How can I use the drawing facilities without an ImGui window? (using ImDrawList API)
 | 
			
		||||
  - I integrated Dear ImGui in my engine and the text or lines are blurry..
 | 
			
		||||
  - I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around..
 | 
			
		||||
  - How can I help?
 | 
			
		||||
 | 
			
		||||
CODE
 | 
			
		||||
- Forward Declarations
 | 
			
		||||
- Context and Memory Allocators
 | 
			
		||||
- User facing structures (ImGuiStyle, ImGuiIO)
 | 
			
		||||
- Helper/Utilities (ImXXX functions, Color functions)
 | 
			
		||||
- ImGuiStorage
 | 
			
		||||
- ImGuiTextFilter
 | 
			
		||||
- ImGuiTextBuffer
 | 
			
		||||
- ImGuiListClipper
 | 
			
		||||
- Main Code (most of the code! lots of stuff, needs tidying up)
 | 
			
		||||
- Tooltips
 | 
			
		||||
- Popups
 | 
			
		||||
- Navigation
 | 
			
		||||
- Columns
 | 
			
		||||
- Drag and Drop
 | 
			
		||||
- Logging
 | 
			
		||||
- Settings
 | 
			
		||||
- Platform Dependent Helpers
 | 
			
		||||
- Metrics/Debug window
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
// Documentation
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
 MISSION STATEMENT
 | 
			
		||||
 =================
 | 
			
		||||
@@ -483,11 +509,6 @@
 | 
			
		||||
 - 2014/08/28 (1.09) - changed the behavior of IO.PixelCenterOffset following various rendering fixes
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 ISSUES & TODO-LIST
 | 
			
		||||
 ==================
 | 
			
		||||
 See TODO.txt
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 FREQUENTLY ASKED QUESTIONS (FAQ), TIPS
 | 
			
		||||
 ======================================
 | 
			
		||||
 | 
			
		||||
@@ -887,6 +908,11 @@ static void*            SettingsHandlerWindow_ReadOpen(ImGuiContext*, ImGuiSetti
 | 
			
		||||
static void             SettingsHandlerWindow_ReadLine(ImGuiContext*, ImGuiSettingsHandler*, void* entry, const char* line);
 | 
			
		||||
static void             SettingsHandlerWindow_WriteAll(ImGuiContext* imgui_ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf);
 | 
			
		||||
 | 
			
		||||
// Platform Dependents default implementation for IO functions
 | 
			
		||||
static const char*      GetClipboardTextFn_DefaultImpl(void* user_data);
 | 
			
		||||
static void             SetClipboardTextFn_DefaultImpl(void* user_data, const char* text);
 | 
			
		||||
static void             ImeSetInputScreenPosFn_DefaultImpl(int x, int y);
 | 
			
		||||
 | 
			
		||||
namespace ImGui
 | 
			
		||||
{
 | 
			
		||||
static bool             BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags);
 | 
			
		||||
@@ -918,13 +944,6 @@ static int              FindPlatformMonitorForRect(const ImRect& r);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
// Platform dependent default implementations
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
static const char*      GetClipboardTextFn_DefaultImpl(void* user_data);
 | 
			
		||||
static void             SetClipboardTextFn_DefaultImpl(void* user_data, const char* text);
 | 
			
		||||
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
// Context and Memory Allocators
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
@@ -955,7 +974,7 @@ static void   (*GImAllocatorFreeFunc)(void* ptr, void* user_data) = FreeWrapper;
 | 
			
		||||
static void*    GImAllocatorUserData = NULL;
 | 
			
		||||
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
// User facing structures
 | 
			
		||||
// User facing main structures
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
ImGuiStyle::ImGuiStyle()
 | 
			
		||||
@@ -1316,7 +1335,7 @@ ImU32 ImHash(const void* data, int data_size, ImU32 seed)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
// ImText* helpers
 | 
			
		||||
// HELPERS/UTILITIES (ImText* helpers)
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
// Convert UTF-8 to 32-bits character, process single character input.
 | 
			
		||||
@@ -2049,10 +2068,11 @@ bool ImGuiListClipper::Step()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
// ImGuiWindow
 | 
			
		||||
// (This type has very few helper methods but otherwise is mostly a dumb struct)
 | 
			
		||||
// MAIN CODE
 | 
			
		||||
// (this category is still too large and badly ordered, needs some tidying up)
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
// ImGuiWindow is mostly a dumb struct. It merely has a constructor and a few helper methods
 | 
			
		||||
ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name)
 | 
			
		||||
    : DrawListInst(&context->DrawListSharedData)
 | 
			
		||||
{
 | 
			
		||||
@@ -2166,11 +2186,6 @@ ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs)
 | 
			
		||||
    return id;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
// MAIN CODE
 | 
			
		||||
// (this category is still too large and badly ordered, needs some tidying up)
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
static void SetCurrentWindow(ImGuiWindow* window)
 | 
			
		||||
{
 | 
			
		||||
    ImGuiContext& g = *GImGui;
 | 
			
		||||
@@ -7318,7 +7333,7 @@ void ImGui::Unindent(float indent_w)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
// TOOLTIP
 | 
			
		||||
// TOOLTIPS
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
void ImGui::BeginTooltip()
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								imgui.h
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
// dear imgui, v1.64 WIP
 | 
			
		||||
// dear imgui, v1.64
 | 
			
		||||
// (headers)
 | 
			
		||||
 | 
			
		||||
// See imgui.cpp file for documentation.
 | 
			
		||||
@@ -23,8 +23,8 @@
 | 
			
		||||
 | 
			
		||||
// Version
 | 
			
		||||
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY00 then bounced up to XYY01 when release tagging happens)
 | 
			
		||||
#define IMGUI_VERSION               "1.64 WIP"
 | 
			
		||||
#define IMGUI_VERSION_NUM           16400
 | 
			
		||||
#define IMGUI_VERSION               "1.64"
 | 
			
		||||
#define IMGUI_VERSION_NUM           16401
 | 
			
		||||
#define IMGUI_CHECKVERSION()        ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert))
 | 
			
		||||
#define IMGUI_HAS_VIEWPORT          1 // Viewport WIP branch
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
// dear imgui, v1.64 WIP
 | 
			
		||||
// dear imgui, v1.64
 | 
			
		||||
// (demo code)
 | 
			
		||||
 | 
			
		||||
// Message to the person tempted to delete this file when integrating ImGui into their code base:
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,20 @@
 | 
			
		||||
// dear imgui, v1.64 WIP
 | 
			
		||||
// dear imgui, v1.64
 | 
			
		||||
// (drawing and font code)
 | 
			
		||||
 | 
			
		||||
// Index of this file:
 | 
			
		||||
// - Default styles
 | 
			
		||||
// - ImDrawList
 | 
			
		||||
// - ImDrawData
 | 
			
		||||
// - ImFontAtlas
 | 
			
		||||
// - Internal Render Helpers
 | 
			
		||||
// - ImFont
 | 
			
		||||
// - Default font data
 | 
			
		||||
/*
 | 
			
		||||
Index of this file:
 | 
			
		||||
- Cruft for stb_truetype/stb_rectpack implementation
 | 
			
		||||
- Style functions (default style)
 | 
			
		||||
- ImDrawList
 | 
			
		||||
- ImDrawData
 | 
			
		||||
- ShadeVertsXXX helpers functions
 | 
			
		||||
- ImFontConfig
 | 
			
		||||
- ImFontAtlas
 | 
			
		||||
- ImFont
 | 
			
		||||
- Internal Render Helpers
 | 
			
		||||
- Default font data
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
 | 
			
		||||
#define _CRT_SECURE_NO_WARNINGS
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
// dear imgui, v1.64 WIP
 | 
			
		||||
// dear imgui, v1.64
 | 
			
		||||
// (internal structures/api)
 | 
			
		||||
 | 
			
		||||
// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,26 @@
 | 
			
		||||
// dear imgui, v1.64 WIP
 | 
			
		||||
// dear imgui, v1.64
 | 
			
		||||
// (widgets code)
 | 
			
		||||
 | 
			
		||||
// Index of this file:
 | 
			
		||||
// - Widgets: Text, etc.
 | 
			
		||||
// - Widgets: Button, Image, Checkbox, RadioButton, ProgressBar, Bullet, etc.
 | 
			
		||||
// - Widgets: ComboBox
 | 
			
		||||
// - Data Type and Data Formatting Helpers
 | 
			
		||||
// - Widgets: DragScalar, DragFloat, DragInt, etc.
 | 
			
		||||
// - Widgets: SliderScalar, SliderFloat, SliderInt, etc.
 | 
			
		||||
// - Widgets: InputScalar, InputFloat, InputInt, etc.
 | 
			
		||||
// - Widgets: InputText, InputTextMultiline
 | 
			
		||||
// - Widgets: ColorEdit, ColorPicker, ColorButton, etc.
 | 
			
		||||
// - Widgets: TreeNode, TreePush, TreePop, etc.
 | 
			
		||||
// - Widgets: Selectable
 | 
			
		||||
// - Widgets: ListBox
 | 
			
		||||
// - Widgets: PlotLines, PlotHistogram
 | 
			
		||||
// - Widgets: Value
 | 
			
		||||
// - Widgets: MenuItem, BeginMenu, EndMenu, etc.
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
Index of this file:
 | 
			
		||||
- Widgets: Text, etc.
 | 
			
		||||
- Widgets: Button, Image, Checkbox, RadioButton, ProgressBar, Bullet, etc.
 | 
			
		||||
- Widgets: ComboBox
 | 
			
		||||
- Data Type and Data Formatting Helpers
 | 
			
		||||
- Widgets: DragScalar, DragFloat, DragInt, etc.
 | 
			
		||||
- Widgets: SliderScalar, SliderFloat, SliderInt, etc.
 | 
			
		||||
- Widgets: InputScalar, InputFloat, InputInt, etc.
 | 
			
		||||
- Widgets: InputText, InputTextMultiline
 | 
			
		||||
- Widgets: ColorEdit, ColorPicker, ColorButton, etc.
 | 
			
		||||
- Widgets: TreeNode, TreePush, TreePop, etc.
 | 
			
		||||
- Widgets: Selectable
 | 
			
		||||
- Widgets: ListBox
 | 
			
		||||
- Widgets: PlotLines, PlotHistogram
 | 
			
		||||
- Widgets: Value
 | 
			
		||||
- Widgets: MenuItem, BeginMenu, EndMenu, etc.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
 | 
			
		||||
#define _CRT_SECURE_NO_WARNINGS
 | 
			
		||||
@@ -96,10 +100,6 @@ static bool             SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataT
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//-------------------------------------------------------------------------
 | 
			
		||||
// SHARED UTILITIES
 | 
			
		||||
//-------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
//-------------------------------------------------------------------------
 | 
			
		||||
// WIDGETS: Text
 | 
			
		||||
// - TextUnformatted()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user