From be6ea86f8d3a0bb2b72b3cab6dfa761779370915 Mon Sep 17 00:00:00 2001 From: Omar Cornut Date: Fri, 31 Aug 2018 11:29:25 +0200 Subject: [PATCH 1/3] OSX: Added imgui_widgets.cpp to xcode project files. --- .../example_apple_metal.xcodeproj/project.pbxproj | 10 +++++++++- .../example_apple_opengl2.xcodeproj/project.pbxproj | 12 ++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj b/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj index b1b6b4e74..533fef91f 100644 --- a/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj +++ b/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 07A82ED82139413D0078D120 /* imgui_widgets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07A82ED72139413C0078D120 /* imgui_widgets.cpp */; }; + 07A82ED92139418F0078D120 /* imgui_widgets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07A82ED72139413C0078D120 /* imgui_widgets.cpp */; }; 8307E7CC20E9F9C900473790 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7CB20E9F9C900473790 /* ViewController.mm */; }; 8307E7CF20E9F9C900473790 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8307E7CD20E9F9C900473790 /* Main.storyboard */; }; 8307E7DE20E9F9C900473790 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7DD20E9F9C900473790 /* AppDelegate.m */; }; @@ -37,6 +39,8 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 07A82ED62139413C0078D120 /* imgui_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui_internal.h; path = ../../imgui_internal.h; sourceTree = ""; }; + 07A82ED72139413C0078D120 /* imgui_widgets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_widgets.cpp; path = ../../imgui_widgets.cpp; sourceTree = ""; }; 8307E7BB20E9F9C700473790 /* Renderer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Renderer.h; sourceTree = ""; }; 8307E7BC20E9F9C700473790 /* Renderer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Renderer.mm; sourceTree = ""; }; 8307E7C420E9F9C900473790 /* example_apple_metal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_apple_metal.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -169,10 +173,12 @@ isa = PBXGroup; children = ( 83BBEA0420EB54E700295997 /* imconfig.h */, + 83BBEA0320EB54E700295997 /* imgui.cpp */, 83BBEA0020EB54E700295997 /* imgui.h */, 83BBEA0220EB54E700295997 /* imgui_demo.cpp */, 83BBEA0120EB54E700295997 /* imgui_draw.cpp */, - 83BBEA0320EB54E700295997 /* imgui.cpp */, + 07A82ED62139413C0078D120 /* imgui_internal.h */, + 07A82ED72139413C0078D120 /* imgui_widgets.cpp */, ); name = imgui; sourceTree = ""; @@ -283,6 +289,7 @@ 83BBEA0920EB54E700295997 /* imgui.cpp in Sources */, 83BBEA0720EB54E700295997 /* imgui_demo.cpp in Sources */, 83BBE9FE20EB54D800295997 /* imgui_impl_metal.mm in Sources */, + 07A82ED82139413D0078D120 /* imgui_widgets.cpp in Sources */, 83BBE9DE20EB3FFC00295997 /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -294,6 +301,7 @@ 83BBE9E020EB42D000295997 /* ViewController.mm in Sources */, 8307E7E920E9F9C900473790 /* Renderer.mm in Sources */, 83BBEA0620EB54E700295997 /* imgui_draw.cpp in Sources */, + 07A82ED92139418F0078D120 /* imgui_widgets.cpp in Sources */, 8307E7E720E9F9C900473790 /* main.m in Sources */, 83BBEA0A20EB54E700295997 /* imgui.cpp in Sources */, 83BBEA0820EB54E700295997 /* imgui_demo.cpp in Sources */, diff --git a/examples/example_apple_opengl2/example_apple_opengl2.xcodeproj/project.pbxproj b/examples/example_apple_opengl2/example_apple_opengl2.xcodeproj/project.pbxproj index a325e96da..06c7b50c3 100644 --- a/examples/example_apple_opengl2/example_apple_opengl2.xcodeproj/project.pbxproj +++ b/examples/example_apple_opengl2/example_apple_opengl2.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 07A82EDB213941D00078D120 /* imgui_widgets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07A82EDA213941D00078D120 /* imgui_widgets.cpp */; }; 4080A99820B02D340036BA46 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4080A98A20B02CD90036BA46 /* main.mm */; }; 4080A9A220B034280036BA46 /* imgui_impl_opengl2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4080A99E20B034280036BA46 /* imgui_impl_opengl2.cpp */; }; 4080A9AD20B0343C0036BA46 /* imgui_demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4080A9A620B0343C0036BA46 /* imgui_demo.cpp */; }; @@ -30,6 +31,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 07A82EDA213941D00078D120 /* imgui_widgets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_widgets.cpp; path = ../../imgui_widgets.cpp; sourceTree = ""; }; 4080A96B20B029B00036BA46 /* example_osx_opengl2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = example_osx_opengl2; sourceTree = BUILT_PRODUCTS_DIR; }; 4080A98A20B02CD90036BA46 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = SOURCE_ROOT; }; 4080A99E20B034280036BA46 /* imgui_impl_opengl2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_impl_opengl2.cpp; path = ../imgui_impl_opengl2.cpp; sourceTree = ""; }; @@ -66,11 +68,12 @@ isa = PBXGroup; children = ( 4080A9AC20B0343C0036BA46 /* imconfig.h */, + 4080A9A720B0343C0036BA46 /* imgui.cpp */, + 4080A9A820B0343C0036BA46 /* imgui.h */, + 07A82EDA213941D00078D120 /* imgui_widgets.cpp */, 4080A9A620B0343C0036BA46 /* imgui_demo.cpp */, 4080A9AA20B0343C0036BA46 /* imgui_draw.cpp */, 4080A9A520B0343C0036BA46 /* imgui_internal.h */, - 4080A9A720B0343C0036BA46 /* imgui.cpp */, - 4080A9A820B0343C0036BA46 /* imgui.h */, 4080A9A920B0343C0036BA46 /* stb_rect_pack.h */, 4080A9AB20B0343C0036BA46 /* stb_textedit.h */, 4080A9A420B0343C0036BA46 /* stb_truetype.h */, @@ -135,7 +138,7 @@ }; }; }; - buildConfigurationList = 4080A96620B029B00036BA46 /* Build configuration list for PBXProject "example_osx_opengl2" */; + buildConfigurationList = 4080A96620B029B00036BA46 /* Build configuration list for PBXProject "example_apple_opengl2" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; @@ -163,6 +166,7 @@ 4080A9A220B034280036BA46 /* imgui_impl_opengl2.cpp in Sources */, 4080A9B020B0347A0036BA46 /* imgui_impl_osx.mm in Sources */, 4080A9AE20B0343C0036BA46 /* imgui.cpp in Sources */, + 07A82EDB213941D00078D120 /* imgui_widgets.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -301,7 +305,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 4080A96620B029B00036BA46 /* Build configuration list for PBXProject "example_osx_opengl2" */ = { + 4080A96620B029B00036BA46 /* Build configuration list for PBXProject "example_apple_opengl2" */ = { isa = XCConfigurationList; buildConfigurations = ( 4080A97020B029B00036BA46 /* Debug */, From 5d40d295b3c98023914d736be2d3bc766bf4ba1c Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 31 Aug 2018 11:33:12 +0200 Subject: [PATCH 2/3] Comments, readme updates --- docs/CHANGELOG.txt | 4 ++-- examples/README.txt | 7 ++++--- imgui.cpp | 5 ++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 73ed9747a..b3156adb7 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -38,8 +38,8 @@ Changes: - 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. - NONE OF THE FUNCTIONS HAVE CHANGED. THE CODE IS SEMANTICALLY 100% IDENTICAL, BUT ALL FUNCTIONS WERE MOVED. + Re-ordered some of the code remaining in imgui.cpp. + NONE OF THE FUNCTIONS HAVE CHANGED. THE CODE IS SEMANTICALLY 100% IDENTICAL, BUT _EVERY_ FUNCTIONS HAS BEEN MOVED. Because of this, any local modifications to imgui.cpp will likely conflict when you update. 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, diff --git a/examples/README.txt b/examples/README.txt index e5764250a..a3fb441c0 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -1,6 +1,7 @@ ---------------------------------------- - README FIRST ---------------------------------------- +----------------------------------------------------------------------- + examples/README.txt + (This is the README file for the examples/ folder. See docs/ for more documentation) +----------------------------------------------------------------------- Dear ImGui is highly portable and only requires a few things to run and render: diff --git a/imgui.cpp b/imgui.cpp index 28b986a87..2fa7e0a9a 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -333,6 +333,9 @@ CODE When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files. You can read releases logs https://github.com/ocornut/imgui/releases for more details. + - 2018/08/31 (1.64) - 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. + NONE OF THE FUNCTIONS HAVE CHANGED. THE CODE IS SEMANTICALLY 100% IDENTICAL, BUT _EVERY_ FUNCTION HAS BEEN MOVED. + Because of this, any local modifications to imgui.cpp will likely conflict when you update. Read docs/CHANGELOG.txt for suggestions. - 2018/08/22 (1.63) - renamed IsItemDeactivatedAfterChange() to IsItemDeactivatedAfterEdit() for consistency with new IsItemEdited() API. Kept redirection function (will obsolete soonish as IsItemDeactivatedAfterChange() is very recent). - 2018/08/21 (1.63) - renamed ImGuiTextEditCallback to ImGuiInputTextCallback, ImGuiTextEditCallbackData to ImGuiInputTextCallbackData for consistency. Kept redirection types (will obsolete). - 2018/08/21 (1.63) - removed ImGuiInputTextCallbackData::ReadOnly since it is a duplication of (ImGuiInputTextCallbackData::Flags & ImGuiInputTextFlags_ReadOnly). @@ -804,7 +807,7 @@ CODE Rectangles provided by ImGui are defined as (x1=left,y1=top,x2=right,y2=bottom) and NOT as (x1,y1,width,height). Q: How can I help? - A: - If you are experienced with Dear ImGui and C++, look at the github issues, or TODO.txt and see how you want/can help! + A: - If you are experienced with Dear ImGui and C++, look at the github issues, or docs/TODO.txt and see how you want/can help! - Convince your company to fund development time! Individual users: you can also become a Patron (patreon.com/imgui) or donate on PayPal! See README. - Disclose your usage of dear imgui via a dev blog post, a tweet, a screenshot, a mention somewhere etc. You may post screenshot or links in the gallery threads (github.com/ocornut/imgui/issues/1269). Visuals are ideal as they inspire other programmers. From 767649afb162dd1dba3b68a132d7401b9a4316f7 Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 31 Aug 2018 18:07:47 +0200 Subject: [PATCH 3/3] Fix missing include on some systems to use intptr_t. (#2036, #2054) --- imgui_widgets.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 285617fe5..c2c67e781 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -33,6 +33,11 @@ Index of this file: #include "imgui_internal.h" #include // toupper, isprint +#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier +#include // intptr_t +#else +#include // intptr_t +#endif // Visual Studio warnings #ifdef _MSC_VER