mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-03 22:51:06 +01:00 
			
		
		
		
	Merge branch 'master' into viewport
# Conflicts: # examples/imgui_impl_sdl.cpp # imgui.cpp
This commit is contained in:
		
							
								
								
									
										39
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								imgui.h
									
									
									
									
									
								
							@@ -37,7 +37,7 @@
 | 
			
		||||
 | 
			
		||||
// Helpers
 | 
			
		||||
#ifndef IM_ASSERT
 | 
			
		||||
#include <assert.h>                                                             
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#define IM_ASSERT(_EXPR)            assert(_EXPR)                               // You can override the default assert handler by editing imconfig.h
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(__clang__) || defined(__GNUC__)
 | 
			
		||||
@@ -53,6 +53,9 @@
 | 
			
		||||
#if defined(__clang__)
 | 
			
		||||
#pragma clang diagnostic push
 | 
			
		||||
#pragma clang diagnostic ignored "-Wold-style-cast"
 | 
			
		||||
#elif defined(__GNUC__) && __GNUC__ >= 8
 | 
			
		||||
#pragma GCC diagnostic push
 | 
			
		||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Forward declarations
 | 
			
		||||
@@ -530,7 +533,7 @@ namespace ImGui
 | 
			
		||||
    IMGUI_API void          SetItemAllowOverlap();                                              // allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area.
 | 
			
		||||
    IMGUI_API bool          IsRectVisible(const ImVec2& size);                                  // test if rectangle (of given size, starting from cursor position) is visible / not clipped.
 | 
			
		||||
    IMGUI_API bool          IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max);      // test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side.
 | 
			
		||||
    IMGUI_API float         GetTime();
 | 
			
		||||
    IMGUI_API double        GetTime();
 | 
			
		||||
    IMGUI_API int           GetFrameCount();
 | 
			
		||||
    IMGUI_API ImDrawList*   GetOverlayDrawList();                                               // this draw list will be the last rendered. it covers the entire current viewport. useful to quickly draw overlays shapes/text
 | 
			
		||||
    IMGUI_API ImDrawListSharedData* GetDrawListSharedData();                                    // you may use this when creating your own ImDrawList instances
 | 
			
		||||
@@ -1182,7 +1185,7 @@ struct ImGuiIO
 | 
			
		||||
 | 
			
		||||
    ImVec2      MousePosPrev;               // Previous mouse position temporary storage (nb: not for public use, set to MousePos in NewFrame())
 | 
			
		||||
    ImVec2      MouseClickedPos[5];         // Position at time of clicking
 | 
			
		||||
    float       MouseClickedTime[5];        // Time of last click (used to figure out double-click)
 | 
			
		||||
    double      MouseClickedTime[5];        // Time of last click (used to figure out double-click)
 | 
			
		||||
    bool        MouseClicked[5];            // Mouse button went from !Down to Down
 | 
			
		||||
    bool        MouseDoubleClicked[5];      // Has mouse button been double-clicked?
 | 
			
		||||
    bool        MouseReleased[5];           // Mouse button went from Down to !Down
 | 
			
		||||
@@ -1332,6 +1335,14 @@ struct ImGuiOnceUponAFrame
 | 
			
		||||
// Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
 | 
			
		||||
struct ImGuiTextFilter
 | 
			
		||||
{
 | 
			
		||||
    IMGUI_API           ImGuiTextFilter(const char* default_filter = "");
 | 
			
		||||
    IMGUI_API bool      Draw(const char* label = "Filter (inc,-exc)", float width = 0.0f);    // Helper calling InputText+Build
 | 
			
		||||
    IMGUI_API bool      PassFilter(const char* text, const char* text_end = NULL) const;
 | 
			
		||||
    IMGUI_API void      Build();
 | 
			
		||||
    void                Clear()          { InputBuf[0] = 0; Build(); }
 | 
			
		||||
    bool                IsActive() const { return !Filters.empty(); }
 | 
			
		||||
 | 
			
		||||
    // [Internal]
 | 
			
		||||
    struct TextRange
 | 
			
		||||
    {
 | 
			
		||||
        const char* b;
 | 
			
		||||
@@ -1339,25 +1350,14 @@ struct ImGuiTextFilter
 | 
			
		||||
 | 
			
		||||
        TextRange() { b = e = NULL; }
 | 
			
		||||
        TextRange(const char* _b, const char* _e) { b = _b; e = _e; }
 | 
			
		||||
        const char* begin() const { return b; }
 | 
			
		||||
        const char* end() const { return e; }
 | 
			
		||||
        bool empty() const { return b == e; }
 | 
			
		||||
        char front() const { return *b; }
 | 
			
		||||
        static bool is_blank(char c) { return c == ' ' || c == '\t'; }
 | 
			
		||||
        void trim_blanks() { while (b < e && is_blank(*b)) b++; while (e > b && is_blank(*(e-1))) e--; }
 | 
			
		||||
        IMGUI_API void split(char separator, ImVector<TextRange>& out);
 | 
			
		||||
        const char*     begin() const   { return b; }
 | 
			
		||||
        const char*     end () const    { return e; }
 | 
			
		||||
        bool            empty() const   { return b == e; }
 | 
			
		||||
        IMGUI_API void  split(char separator, ImVector<TextRange>* out) const;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    char                InputBuf[256];
 | 
			
		||||
    ImVector<TextRange> Filters;
 | 
			
		||||
    int                 CountGrep;
 | 
			
		||||
 | 
			
		||||
    IMGUI_API           ImGuiTextFilter(const char* default_filter = "");
 | 
			
		||||
    IMGUI_API bool      Draw(const char* label = "Filter (inc,-exc)", float width = 0.0f);    // Helper calling InputText+Build
 | 
			
		||||
    IMGUI_API bool      PassFilter(const char* text, const char* text_end = NULL) const;
 | 
			
		||||
    IMGUI_API void      Build();
 | 
			
		||||
    void                Clear() { InputBuf[0] = 0; Build(); }
 | 
			
		||||
    bool                IsActive() const { return !Filters.empty(); }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// Helper: Text buffer for logging/accumulating text
 | 
			
		||||
@@ -1875,6 +1875,7 @@ struct ImFontAtlas
 | 
			
		||||
    // Members
 | 
			
		||||
    //-------------------------------------------
 | 
			
		||||
 | 
			
		||||
    bool                        Locked;             // Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
 | 
			
		||||
    ImFontAtlasFlags            Flags;              // Build flags (see ImFontAtlasFlags_)
 | 
			
		||||
    ImTextureID                 TexID;              // User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure.
 | 
			
		||||
    int                         TexDesiredWidth;    // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
 | 
			
		||||
@@ -2050,6 +2051,8 @@ struct ImGuiViewport
 | 
			
		||||
 | 
			
		||||
#if defined(__clang__)
 | 
			
		||||
#pragma clang diagnostic pop
 | 
			
		||||
#elif defined(__GNUC__) && __GNUC__ >= 8
 | 
			
		||||
#pragma GCC diagnostic pop
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Include imgui_user.h at the end of imgui.h (convenient for user to only explicitly include vanilla imgui.h)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user