mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 11:57:00 +00:00
This commit is contained in:
parent
cc5058e5d7
commit
f2a522d70d
@ -148,6 +148,7 @@ Other Changes:
|
|||||||
which would result in an abnormal number of vertices created (was slower and more likely to
|
which would result in an abnormal number of vertices created (was slower and more likely to
|
||||||
asserts with 16-bits ImDrawVtx). (#5720)
|
asserts with 16-bits ImDrawVtx). (#5720)
|
||||||
- Fonts: Added GetGlyphRangesGreek() helper for Greek & Coptic glyph range. (#5676, #5727) [@azonenberg]
|
- Fonts: Added GetGlyphRangesGreek() helper for Greek & Coptic glyph range. (#5676, #5727) [@azonenberg]
|
||||||
|
- ImDrawList: Not using alloca() anymore, lift single polygon size limits. (#5704, #1811)
|
||||||
- Platform IME: [Windows] Removed call to ImmAssociateContextEx() leading to freeze on some setups.
|
- Platform IME: [Windows] Removed call to ImmAssociateContextEx() leading to freeze on some setups.
|
||||||
(#2589, #5535, #5264, #4972)
|
(#2589, #5535, #5264, #4972)
|
||||||
- Misc: ImGuiKey is now a typed enum, allowing ImGuiKey_XXX symbols to be named in debuggers. (#4921)
|
- Misc: ImGuiKey is now a typed enum, allowing ImGuiKey_XXX symbols to be named in debuggers. (#4921)
|
||||||
|
@ -4737,6 +4737,7 @@ void ImGui::Shutdown()
|
|||||||
IM_DELETE(g.IO.Fonts);
|
IM_DELETE(g.IO.Fonts);
|
||||||
}
|
}
|
||||||
g.IO.Fonts = NULL;
|
g.IO.Fonts = NULL;
|
||||||
|
g.DrawListSharedData.TempBuffer.clear();
|
||||||
|
|
||||||
// Cleanup of other data are conditional on actually having initialized Dear ImGui.
|
// Cleanup of other data are conditional on actually having initialized Dear ImGui.
|
||||||
if (!g.Initialized)
|
if (!g.Initialized)
|
||||||
|
6
imgui.h
6
imgui.h
@ -23,7 +23,7 @@
|
|||||||
// Library Version
|
// Library Version
|
||||||
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345')
|
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345')
|
||||||
#define IMGUI_VERSION "1.89 WIP"
|
#define IMGUI_VERSION "1.89 WIP"
|
||||||
#define IMGUI_VERSION_NUM 18828
|
#define IMGUI_VERSION_NUM 18829
|
||||||
#define IMGUI_HAS_TABLE
|
#define IMGUI_HAS_TABLE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2513,7 +2513,7 @@ struct ImDrawList
|
|||||||
|
|
||||||
// [Internal, used while building lists]
|
// [Internal, used while building lists]
|
||||||
unsigned int _VtxCurrentIdx; // [Internal] generally == VtxBuffer.Size unless we are past 64K vertices, in which case this gets reset to 0.
|
unsigned int _VtxCurrentIdx; // [Internal] generally == VtxBuffer.Size unless we are past 64K vertices, in which case this gets reset to 0.
|
||||||
const ImDrawListSharedData* _Data; // Pointer to shared draw data (you can use ImGui::GetDrawListSharedData() to get the one from current ImGui context)
|
ImDrawListSharedData* _Data; // Pointer to shared draw data (you can use ImGui::GetDrawListSharedData() to get the one from current ImGui context)
|
||||||
const char* _OwnerName; // Pointer to owner window's name for debugging
|
const char* _OwnerName; // Pointer to owner window's name for debugging
|
||||||
ImDrawVert* _VtxWritePtr; // [Internal] point within VtxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
|
ImDrawVert* _VtxWritePtr; // [Internal] point within VtxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
|
||||||
ImDrawIdx* _IdxWritePtr; // [Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
|
ImDrawIdx* _IdxWritePtr; // [Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
|
||||||
@ -2525,7 +2525,7 @@ struct ImDrawList
|
|||||||
float _FringeScale; // [Internal] anti-alias fringe is scaled by this value, this helps to keep things sharp while zooming at vertex buffer content
|
float _FringeScale; // [Internal] anti-alias fringe is scaled by this value, this helps to keep things sharp while zooming at vertex buffer content
|
||||||
|
|
||||||
// If you want to create ImDrawList instances, pass them ImGui::GetDrawListSharedData() or create and use your own ImDrawListSharedData (so you can use ImDrawList without ImGui)
|
// If you want to create ImDrawList instances, pass them ImGui::GetDrawListSharedData() or create and use your own ImDrawListSharedData (so you can use ImDrawList without ImGui)
|
||||||
ImDrawList(const ImDrawListSharedData* shared_data) { memset(this, 0, sizeof(*this)); _Data = shared_data; }
|
ImDrawList(ImDrawListSharedData* shared_data) { memset(this, 0, sizeof(*this)); _Data = shared_data; }
|
||||||
|
|
||||||
~ImDrawList() { _ClearFreeMemory(); }
|
~ImDrawList() { _ClearFreeMemory(); }
|
||||||
IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect = false); // Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
|
IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect = false); // Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
|
||||||
|
@ -39,25 +39,12 @@ Index of this file:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h> // vsnprintf, sscanf, printf
|
#include <stdio.h> // vsnprintf, sscanf, printf
|
||||||
#if !defined(alloca)
|
|
||||||
#if defined(__GLIBC__) || defined(__sun) || defined(__APPLE__) || defined(__NEWLIB__)
|
|
||||||
#include <alloca.h> // alloca (glibc uses <alloca.h>. Note that Cygwin may have _WIN32 defined, so the order matters here)
|
|
||||||
#elif defined(_WIN32)
|
|
||||||
#include <malloc.h> // alloca
|
|
||||||
#if !defined(alloca)
|
|
||||||
#define alloca _alloca // for clang with MS Codegen
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#include <stdlib.h> // alloca
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Visual Studio warnings
|
// Visual Studio warnings
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning (disable: 4127) // condition expression is constant
|
#pragma warning (disable: 4127) // condition expression is constant
|
||||||
#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
|
#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
|
||||||
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
|
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
|
||||||
#pragma warning (disable: 6255) // [Static Analyzer] _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead.
|
|
||||||
#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
|
#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
|
||||||
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). [MSVC Static Analyzer)
|
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). [MSVC Static Analyzer)
|
||||||
#endif
|
#endif
|
||||||
@ -67,9 +54,6 @@ Index of this file:
|
|||||||
#if __has_warning("-Wunknown-warning-option")
|
#if __has_warning("-Wunknown-warning-option")
|
||||||
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' // not all warnings are known by all Clang versions and they tend to be rename-happy.. so ignoring warnings triggers new warnings on some configuration. Great!
|
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' // not all warnings are known by all Clang versions and they tend to be rename-happy.. so ignoring warnings triggers new warnings on some configuration. Great!
|
||||||
#endif
|
#endif
|
||||||
#if __has_warning("-Walloca")
|
|
||||||
#pragma clang diagnostic ignored "-Walloca" // warning: use of function '__builtin_alloca' is discouraged
|
|
||||||
#endif
|
|
||||||
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
|
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
|
||||||
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
|
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
|
||||||
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok.
|
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok.
|
||||||
@ -753,7 +737,8 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
|
|||||||
|
|
||||||
// Temporary buffer
|
// Temporary buffer
|
||||||
// The first <points_count> items are normals at each line point, then after that there are either 2 or 4 temp points for each line point
|
// The first <points_count> items are normals at each line point, then after that there are either 2 or 4 temp points for each line point
|
||||||
ImVec2* temp_normals = (ImVec2*)alloca(points_count * ((use_texture || !thick_line) ? 3 : 5) * sizeof(ImVec2)); //-V630
|
_Data->TempBuffer.reserve_discard(points_count * ((use_texture || !thick_line) ? 3 : 5));
|
||||||
|
ImVec2* temp_normals = _Data->TempBuffer.Data;
|
||||||
ImVec2* temp_points = temp_normals + points_count;
|
ImVec2* temp_points = temp_normals + points_count;
|
||||||
|
|
||||||
// Calculate normals (tangents) for each line segment
|
// Calculate normals (tangents) for each line segment
|
||||||
@ -1001,7 +986,8 @@ void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_coun
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compute normals
|
// Compute normals
|
||||||
ImVec2* temp_normals = (ImVec2*)alloca(points_count * sizeof(ImVec2)); //-V630
|
_Data->TempBuffer.reserve_discard(points_count);
|
||||||
|
ImVec2* temp_normals = _Data->TempBuffer.Data;
|
||||||
for (int i0 = points_count - 1, i1 = 0; i1 < points_count; i0 = i1++)
|
for (int i0 = points_count - 1, i1 = 0; i1 < points_count; i0 = i1++)
|
||||||
{
|
{
|
||||||
const ImVec2& p0 = points[i0];
|
const ImVec2& p0 = points[i0];
|
||||||
|
@ -734,6 +734,9 @@ struct IMGUI_API ImDrawListSharedData
|
|||||||
ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
|
ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
|
||||||
ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
|
ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
|
||||||
|
|
||||||
|
// [Internal] Temp write buffer
|
||||||
|
ImVector<ImVec2> TempBuffer;
|
||||||
|
|
||||||
// [Internal] Lookup tables
|
// [Internal] Lookup tables
|
||||||
ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE]; // Sample points on the quarter of the circle.
|
ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE]; // Sample points on the quarter of the circle.
|
||||||
float ArcFastRadiusCutoff; // Cutoff radius after which arc drawing will fallback to slower PathArcTo()
|
float ArcFastRadiusCutoff; // Cutoff radius after which arc drawing will fallback to slower PathArcTo()
|
||||||
|
Loading…
Reference in New Issue
Block a user