mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-20 06:46:36 +00:00
Merge branch 'master' into docking
# Conflicts: # docs/CHANGELOG.txt
This commit is contained in:
commit
5a7d18a441
@ -195,7 +195,7 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
||||
IM_ASSERT(io.BackendRendererUserData == NULL && "Already initialized a renderer backend!");
|
||||
|
||||
// Initialize our loader
|
||||
#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3)
|
||||
#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3) && !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM)
|
||||
if (imgl3wInit() != 0)
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize OpenGL loader!\n");
|
||||
@ -204,7 +204,7 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
||||
#endif
|
||||
|
||||
// Setup backend capabilities flags
|
||||
ImGui_ImplOpenGL3_Data* bd = IM_NEW(ImGui_ImplOpenGL3_Data)();;
|
||||
ImGui_ImplOpenGL3_Data* bd = IM_NEW(ImGui_ImplOpenGL3_Data)();
|
||||
io.BackendRendererUserData = (void*)bd;
|
||||
io.BackendRendererName = "imgui_impl_opengl3";
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// We embed our own OpenGL loader to not require user to provide their own or to have to use ours, which proved to be endless problems for users.
|
||||
// Our loader is custom-generated, based on gl3w but automatically filtered to only include enums/functions that we use in this source file.
|
||||
// Regenerate with: python gl3w_gen.py --imgui-dir /path/to/imgui/
|
||||
@ -138,6 +139,7 @@ typedef khronos_uint8_t GLubyte;
|
||||
#define GL_SCISSOR_BOX 0x0C10
|
||||
#define GL_SCISSOR_TEST 0x0C11
|
||||
#define GL_UNPACK_ROW_LENGTH 0x0CF2
|
||||
#define GL_PACK_ALIGNMENT 0x0D05
|
||||
#define GL_TEXTURE_2D 0x0DE1
|
||||
#define GL_UNSIGNED_BYTE 0x1401
|
||||
#define GL_UNSIGNED_SHORT 0x1403
|
||||
@ -159,6 +161,7 @@ typedef void (APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloa
|
||||
typedef void (APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
|
||||
typedef void (APIENTRYP PFNGLENABLEPROC) (GLenum cap);
|
||||
typedef void (APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
|
||||
typedef void (APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
|
||||
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
|
||||
typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
|
||||
@ -173,6 +176,7 @@ GLAPI void APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfl
|
||||
GLAPI void APIENTRY glDisable (GLenum cap);
|
||||
GLAPI void APIENTRY glEnable (GLenum cap);
|
||||
GLAPI void APIENTRY glPixelStorei (GLenum pname, GLint param);
|
||||
GLAPI void APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
|
||||
GLAPI void APIENTRY glGetIntegerv (GLenum pname, GLint *data);
|
||||
GLAPI const GLubyte *APIENTRY glGetString (GLenum name);
|
||||
GLAPI GLboolean APIENTRY glIsEnabled (GLenum cap);
|
||||
@ -221,7 +225,6 @@ typedef khronos_intptr_t GLintptr;
|
||||
#define GL_ARRAY_BUFFER 0x8892
|
||||
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
||||
#define GL_ARRAY_BUFFER_BINDING 0x8894
|
||||
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
|
||||
#define GL_STREAM_DRAW 0x88E0
|
||||
typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
|
||||
typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
|
||||
@ -298,6 +301,7 @@ typedef khronos_uint16_t GLhalf;
|
||||
#define GL_MAJOR_VERSION 0x821B
|
||||
#define GL_MINOR_VERSION 0x821C
|
||||
#define GL_NUM_EXTENSIONS 0x821D
|
||||
#define GL_FRAMEBUFFER_SRGB 0x8DB9
|
||||
#define GL_VERTEX_ARRAY_BINDING 0x85B5
|
||||
typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
|
||||
typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
|
||||
@ -344,12 +348,8 @@ typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum
|
||||
#endif /* GL_VERSION_4_3 */
|
||||
#ifndef GL_VERSION_4_5
|
||||
#define GL_CLIP_ORIGIN 0x935C
|
||||
typedef void (APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth);
|
||||
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint *param);
|
||||
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glClipControl (GLenum origin, GLenum depth);
|
||||
#endif
|
||||
#endif /* GL_VERSION_4_5 */
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
typedef khronos_uint64_t GLuint64EXT;
|
||||
@ -430,7 +430,6 @@ union GL3WProcs {
|
||||
PFNGLBUFFERDATAPROC BufferData;
|
||||
PFNGLCLEARPROC Clear;
|
||||
PFNGLCLEARCOLORPROC ClearColor;
|
||||
PFNGLCLIPCONTROLPROC ClipControl;
|
||||
PFNGLCOMPILESHADERPROC CompileShader;
|
||||
PFNGLCREATEPROGRAMPROC CreateProgram;
|
||||
PFNGLCREATESHADERPROC CreateShader;
|
||||
@ -461,6 +460,7 @@ union GL3WProcs {
|
||||
PFNGLLINKPROGRAMPROC LinkProgram;
|
||||
PFNGLPIXELSTOREIPROC PixelStorei;
|
||||
PFNGLPOLYGONMODEPROC PolygonMode;
|
||||
PFNGLREADPIXELSPROC ReadPixels;
|
||||
PFNGLSCISSORPROC Scissor;
|
||||
PFNGLSHADERSOURCEPROC ShaderSource;
|
||||
PFNGLTEXIMAGE2DPROC TexImage2D;
|
||||
@ -488,7 +488,6 @@ GL3W_API extern union GL3WProcs gl3wProcs;
|
||||
#define glBufferData gl3wProcs.gl.BufferData
|
||||
#define glClear gl3wProcs.gl.Clear
|
||||
#define glClearColor gl3wProcs.gl.ClearColor
|
||||
#define glClipControl gl3wProcs.gl.ClipControl
|
||||
#define glCompileShader gl3wProcs.gl.CompileShader
|
||||
#define glCreateProgram gl3wProcs.gl.CreateProgram
|
||||
#define glCreateShader gl3wProcs.gl.CreateShader
|
||||
@ -519,6 +518,7 @@ GL3W_API extern union GL3WProcs gl3wProcs;
|
||||
#define glLinkProgram gl3wProcs.gl.LinkProgram
|
||||
#define glPixelStorei gl3wProcs.gl.PixelStorei
|
||||
#define glPolygonMode gl3wProcs.gl.PolygonMode
|
||||
#define glReadPixels gl3wProcs.gl.ReadPixels
|
||||
#define glScissor gl3wProcs.gl.Scissor
|
||||
#define glShaderSource gl3wProcs.gl.ShaderSource
|
||||
#define glTexImage2D gl3wProcs.gl.TexImage2D
|
||||
@ -528,6 +528,7 @@ GL3W_API extern union GL3WProcs gl3wProcs;
|
||||
#define glUseProgram gl3wProcs.gl.UseProgram
|
||||
#define glVertexAttribPointer gl3wProcs.gl.VertexAttribPointer
|
||||
#define glViewport gl3wProcs.gl.Viewport
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@ -672,7 +673,6 @@ static const char *proc_names[] = {
|
||||
"glBufferData",
|
||||
"glClear",
|
||||
"glClearColor",
|
||||
"glClipControl",
|
||||
"glCompileShader",
|
||||
"glCreateProgram",
|
||||
"glCreateShader",
|
||||
@ -703,6 +703,7 @@ static const char *proc_names[] = {
|
||||
"glLinkProgram",
|
||||
"glPixelStorei",
|
||||
"glPolygonMode",
|
||||
"glReadPixels",
|
||||
"glScissor",
|
||||
"glShaderSource",
|
||||
"glTexImage2D",
|
||||
|
@ -100,14 +100,17 @@ Other changes:
|
||||
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
VERSION 1.84 WIP (In Progress)
|
||||
VERSION 1.84 (Released 2021-08-20)
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
Decorated log: https://github.com/ocornut/imgui/releases/tag/v1.84
|
||||
|
||||
Breaking Changes:
|
||||
|
||||
- Commented out redirecting functions/enums names that were marked obsolete in 1.67 and 1.69 (March 2019):
|
||||
- ImGui::GetOverlayDrawList() -> use ImGui::GetForegroundDrawList()
|
||||
- ImFont::GlyphRangesBuilder -> use ImFontGlyphRangesBuilder
|
||||
- Backends: OpenGL3: added a third source file "imgui_impl_opengl3_loader.h". [@rokups]
|
||||
- Backends: GLFW: backend now uses glfwSetCursorEnterCallback(). (#3751, #4377, #2445)
|
||||
- Backends: GLFW: backend now uses glfwSetWindowFocusCallback(). (#4388) [@thedmd]
|
||||
- If calling ImGui_ImplGlfw_InitXXX with install_callbacks=true: this is already done for you.
|
||||
@ -121,16 +124,26 @@ Breaking Changes:
|
||||
receive mouse clicks events on window focus, otherwise SDL doesn't emit the event. (#3751, #4377, #2445)
|
||||
This is unfortunately a global SDL setting, so enabling it _might_ have a side-effect on your application.
|
||||
It is unlikely to make a difference, but if your app absolutely needs to ignore the initial on-focus click:
|
||||
you can ignore SDL_MOUSEBUTTONDOWN that events coming right after a SDL_WINDOWEVENT_FOCUS_GAINED event).
|
||||
- Backends: OpenGL3: added a third source file "imgui_impl_opengl3_loader.h". [@rokups]
|
||||
you can ignore SDL_MOUSEBUTTONDOWN events coming right after a SDL_WINDOWEVENT_FOCUS_GAINED event).
|
||||
- Internals: (for custom widgets): because disabled items now sets HoveredId, if you want custom widgets to
|
||||
not react as hovered when disabled, in the majority of use cases it is preferable to check the "hovered"
|
||||
return value of ButtonBehavior() rather than (HoveredId == id).
|
||||
|
||||
Other Changes:
|
||||
|
||||
- IO: Added io.AddFocusEvent() api for backend to tell when host window has gained/lost focus. (#4388) [@thedmd]
|
||||
If you use a custom backend, consider adding support for this!
|
||||
- Windows: ImGuiWindowFlags_UnsavedDocument/ImGuiTabItmeFlags_UnsavedDocument display a dot instead of a '*' so it
|
||||
- Disabled: added BeginDisabled()/EndDisabled() api to create a scope where interactions are disabled. (#211)
|
||||
- Added style.DisabledAlpha (default to 0.60f) and ImGuiStyleVar_DisabledAlpha. (#211)
|
||||
- Unlike the internal-and-undocumented-but-somehow-known PushItemFlag(ImGuiItemFlags_Disabled), this also alters
|
||||
visuals. Currently this is done by lowering alpha of all widgets. Future styling system may do that differently.
|
||||
- Disabled items set HoveredId, allowing e.g. HoveredIdTimer to run. (#211, #3419) [@rokups]
|
||||
- Disabled items more consistently release ActiveId if the active item got disabled. (#211)
|
||||
- Nav: Fixed disabled items from being candidate for default focus. (#211, #787)
|
||||
- Fixed Selectable() selection not showing when disabled. (#211)
|
||||
- Fixed IsItemHovered() returning true on disabled item when navigated to. (#211)
|
||||
- Fixed IsItemHovered() when popping disabled state after item, or when using Selectable_Disabled. (#211)
|
||||
- Windows: ImGuiWindowFlags_UnsavedDocument/ImGuiTabItemFlags_UnsavedDocument displays a dot instead of a '*' so it
|
||||
is independent from font style. When in a tab, the dot is displayed at the same position as the close button.
|
||||
Added extra comments to clarify the purpose of this flag in the context of docked windows.
|
||||
- Tables: Added ImGuiTableColumnFlags_Disabled acting a master disable over (hidden from user/context menu). (#3935)
|
||||
@ -138,28 +151,22 @@ Other Changes:
|
||||
because it manipulates the user-accessible show/hide state. (#3935)
|
||||
- Tables: Added ImGuiTableColumnFlags_NoHeaderLabel to request TableHeadersRow() to not submit label for a column.
|
||||
Convenient for some small columns. Name will still appear in context menu. (#4206).
|
||||
- Tables: Fix columns order on TableSetupScrollFreeze() if previous data got frozen columns out of their section.
|
||||
- Tables: Fix invalid data in TableGetSortSpecs() when SpecsDirty flag is unset. (#4233)
|
||||
- Tables: Fixed columns order on TableSetupScrollFreeze() if previous data got frozen columns out of their section.
|
||||
- Tables: Fixed invalid data in TableGetSortSpecs() when SpecsDirty flag is unset. (#4233)
|
||||
- TabBar: Fixed using more than 32 KB-worth of tab names. (#4176)
|
||||
- InputInt/InputFloat: When used with Steps values and _ReadOnly flag, the step button look disabled. (#211)
|
||||
- InputText: Fixed named filtering flags disabling newline or tabs in multiline inputs (#4409, #4410) [@kfsone]
|
||||
- Drag and Drop: drop target highlight doesn't try to bypass host clipping rectangle. (#4281, #3272)
|
||||
- Drag and Drop: fix using AcceptDragDropPayload() with ImGuiDragDropFlags_AcceptNoPreviewTooltip. [@JeffM2501]
|
||||
- Drag and Drop: Fixed using AcceptDragDropPayload() with ImGuiDragDropFlags_AcceptNoPreviewTooltip. [@JeffM2501]
|
||||
- Menus: MenuItem() and BeginMenu() are not affected/overlapping when style.SelectableTextAlign is altered.
|
||||
- Menus: fix hovering a disabled menu or menu item not closing other menus. (#211)
|
||||
- Popups: fix BeginPopup/OpenPopup sequence failing when there are no focused windows. (#4308) [@rokups]
|
||||
- Menus: Fixed hovering a disabled menu or menu item not closing other menus. (#211)
|
||||
- Popups: Fixed BeginPopup/OpenPopup sequence failing when there are no focused windows. (#4308) [@rokups]
|
||||
- Nav: Alt doesn't toggle menu layer if other modifiers are held. (#4439)
|
||||
- Nav: Disabled items are not candidate for default focus. (#211, #787)
|
||||
- Disabled: disabled items set HoveredId, allowing e.g. HoveredIdTimer to function. (#211, #3419) [@rokups]
|
||||
- Disabled: disabled mode more consistently release active id if the active item got disabled. (#211)
|
||||
- Disabled: disabled mode doesn't prevent Selectable() from looking selected. (#211)
|
||||
- Disabled: fixed IsItemHovered() returning true on disabled item when navigated to. (#211)
|
||||
- Disabled: fixed IsItemHovered() if popped disabled state after item, or when using Selectable_Disabled. (#211)
|
||||
- Fixed printf-style format checks on non-MinGW flavors. (#4183, #3592)
|
||||
- Fonts: Functions with a 'float size_pixels' parameter can accept zero if it is set in ImFontSize::SizePixels.
|
||||
- Fonts: Prefer using U+FFFD character for fallback instead of '?', if available. (#4269)
|
||||
- Fonts: Use U+FF0E dot character to construct an ellipsis if U+002E '.' is not available. (#4269)
|
||||
- Fonts: Add U+FFFD ("replacement character") to default asian glyphs ranges. (#4269)
|
||||
- Fonts: Added U+FFFD ("replacement character") to default asian glyphs ranges. (#4269)
|
||||
- Fonts: Fixed calling ClearTexData() (clearing CPU side font data) triggering an assert in NewFrame(). (#3487)
|
||||
- DrawList: Fixed AddCircle/AddCircleFilled() with auto-tesselation not using accelerated paths for small circles.
|
||||
Fixed AddCircle/AddCircleFilled() with 12 segments which had a broken edge. (#4419, #4421) [@thedmd]
|
||||
@ -170,9 +177,9 @@ Other Changes:
|
||||
- Backends: Reorganized most backends (Win32, SDL, GLFW, OpenGL2/3, DX9/10/11/12, Vulkan, Allegro) to pull their
|
||||
data from a single structure stored inside the main Dear ImGui context. This facilitate/allow usage of standard
|
||||
backends with multiple-contexts BUT is only partially tested and not well supported. It is generally advised to
|
||||
instead use the multi-viewports feature of docking branch where a single Dear ImGui context can be used accross
|
||||
instead use the multi-viewports feature of docking branch where a single Dear ImGui context can be used across
|
||||
multiple windows. (#586, #1851, #2004, #3012, #3934, #4141)
|
||||
- Backends: Win32: Rework to handle certains Windows 8.1/10 features without a manifest. (#4200, #4191)
|
||||
- Backends: Win32: Rework to handle certain Windows 8.1/10 features without a manifest. (#4200, #4191)
|
||||
- ImGui_ImplWin32_GetDpiScaleForMonitor() will handle per-monitor DPI on Windows 10 without a manifest.
|
||||
- ImGui_ImplWin32_EnableDpiAwareness() will call SetProcessDpiAwareness() fallback on Windows 8.1 without a manifest.
|
||||
- Backends: Win32: IME functions are disabled by default for non-Visual Studio compilers (MinGW etc.). Enable with
|
||||
@ -186,7 +193,7 @@ Other Changes:
|
||||
(backend now uses glfwSetCursorEnterCallback(). If you called ImGui_ImplGlfw_InitXXX with install_callbacks=false, you will
|
||||
need to install this callback and forward the data to the backend via ImGui_ImplGlfw_CursorEnterCallback).
|
||||
- Backends: SDL2: Mouse position is correctly reported when the host window is hovered but not focused. (#3751, #4377, #2445)
|
||||
(requires SDL 2.0.5+ as SDL_GetMouseFocus() is only usable with SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH).
|
||||
(enabled with SDL 2.0.5+ as SDL_GetMouseFocus() is only usable with SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH).
|
||||
- Backends: DX9: Explicitly disable texture state stages after >= 1. (#4268) [@NZJenkins]
|
||||
- Backends: DX12: Fix texture casting crash on 32-bit systems (introduced on 2021/05/19 and v1.83) + added comments
|
||||
about building on 32-bit systems. (#4225) [@kingofthebongo2008]
|
||||
@ -200,12 +207,12 @@ Other Changes:
|
||||
- Backends: GLFW: Installing and exposed ImGui_ImplGlfw_MonitorCallback() for forward compatibility with docking branch.
|
||||
- Backends: OSX: Added a fix for shortcuts using CTRL key instead of CMD key. (#4253) [@rokups]
|
||||
- Examples: DX12: Fixed handling of Alt+Enter in example app (using swapchain's ResizeBuffers). (#4346) [@PathogenDavid]
|
||||
- Examples: DX12: Removed unecessary recreation of backend-owned device objects when window is resized. (#4347) [@PathogenDavid]
|
||||
- Examples: DX12: Removed unnecessary recreation of backend-owned device objects when window is resized. (#4347) [@PathogenDavid]
|
||||
- Examples: OpenGL3+GLFW,SDL: Remove include cruft to support variety of GL loaders (no longer necessary). [@rokups]
|
||||
- Examples: OSX+OpenGL2: Fix event forwarding (fix key remaining stuck when using shortcuts with Cmd/Super key).
|
||||
Other OSX examples were not affected. (#4253, #1873) [@rokups]
|
||||
- Examples: Updated all .vcxproj to VS2015 (toolset v140) to facilitate usage with vcpkg.
|
||||
- Examples: SDL2: Accomodate for vcpkg install having headers in SDL2/SDL.h vs SDL.h.
|
||||
- Examples: SDL2: Accommodate for vcpkg install having headers in SDL2/SDL.h vs SDL.h.
|
||||
|
||||
Docking+Viewports Branch:
|
||||
|
||||
|
@ -614,7 +614,7 @@ You may take a look at:
|
||||
- [Quotes](https://github.com/ocornut/imgui/wiki/Quotes)
|
||||
- [Software using Dear ImGui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui)
|
||||
- [Sponsors](https://github.com/ocornut/imgui/wiki/Sponsors)
|
||||
- [Gallery](https://github.com/ocornut/imgui/issues/3793)
|
||||
- [Gallery](https://github.com/ocornut/imgui/issues/4451)
|
||||
|
||||
##### [Return to Index](#index)
|
||||
|
||||
@ -660,7 +660,7 @@ There is an auto-generated [c-api for Dear ImGui (cimgui)](https://github.com/ci
|
||||
- Individuals: you can support continued maintenance and development via PayPal donations. See [README](https://github.com/ocornut/imgui/blob/master/docs/README.md).
|
||||
- If you are experienced with Dear ImGui and C++, look at [GitHub Issues](https://github.com/ocornut/imgui/issues), [GitHub Discussions](https://github.com/ocornut/imgui/discussions), the [Wiki](https://github.com/ocornut/imgui/wiki), read [docs/TODO.txt](https://github.com/ocornut/imgui/blob/master/docs/TODO.txt) and see how you want to help and can help!
|
||||
- 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](https://github.com/ocornut/imgui/issues/3793). Visuals are ideal as they inspire other programmers. Disclosing your use of Dear ImGui helps the library grow credibility, and help other teams and programmers with taking decisions.
|
||||
You may post screenshot or links in the [gallery threads](https://github.com/ocornut/imgui/issues/4451). Visuals are ideal as they inspire other programmers. Disclosing your use of Dear ImGui helps the library grow credibility, and help other teams and programmers with taking decisions.
|
||||
- If you have issues or if you need to hack into the library, even if you don't expect any support it is useful that you share your issues or sometimes incomplete PR.
|
||||
|
||||
##### [Return to Index](#index)
|
||||
|
@ -141,7 +141,7 @@ Some of the goals for 2021 are:
|
||||
|
||||
### Gallery
|
||||
|
||||
For more user-submitted screenshots of projects using Dear ImGui, check out the [Gallery Threads](https://github.com/ocornut/imgui/issues/3793)!
|
||||
For more user-submitted screenshots of projects using Dear ImGui, check out the [Gallery Threads](https://github.com/ocornut/imgui/issues/4451)!
|
||||
|
||||
For a list of third-party widgets and extensions, check out the [Useful Extensions/Widgets](https://github.com/ocornut/imgui/wiki/Useful-Extensions) wiki page.
|
||||
|
||||
@ -174,7 +174,7 @@ Advanced users may want to use the `docking` branch with [Multi-Viewport](https:
|
||||
|
||||
**Who uses Dear ImGui?**
|
||||
|
||||
See the [Quotes](https://github.com/ocornut/imgui/wiki/Quotes), [Sponsors](https://github.com/ocornut/imgui/wiki/Sponsors), [Software using dear imgui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) Wiki pages for an idea of who is using Dear ImGui. Please add your game/software if you can! Also see the [Gallery Threads](https://github.com/ocornut/imgui/issues/3793)!
|
||||
See the [Quotes](https://github.com/ocornut/imgui/wiki/Quotes), [Sponsors](https://github.com/ocornut/imgui/wiki/Sponsors), [Software using dear imgui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) Wiki pages for an idea of who is using Dear ImGui. Please add your game/software if you can! Also see the [Gallery Threads](https://github.com/ocornut/imgui/issues/4451)!
|
||||
|
||||
How to help
|
||||
-----------
|
||||
@ -196,10 +196,16 @@ Sponsors
|
||||
Ongoing Dear ImGui development is currently financially supported by users and private sponsors:
|
||||
|
||||
*Platinum-chocolate sponsors*
|
||||
- [Blizzard](https://careers.blizzard.com/en-us/openings/engineering/all/all/all/1), [Google](https://github.com/google/filament), [Nvidia](https://developer.nvidia.com/nvidia-omniverse)
|
||||
- [Blizzard](https://careers.blizzard.com/en-us/openings/engineering/all/all/all/1)
|
||||
|
||||
*Double-chocolate and Salty caramel sponsors*
|
||||
- [Activision](https://careers.activision.com/c/programmingsoftware-engineering-jobs), [Adobe](https://www.adobe.com/products/medium.html), [Aras Pranckevičius](https://aras-p.info), [Arkane Studios](https://www.arkane-studios.com), [Framefield](http://framefield.com), [Grinding Gear Games](https://www.grindinggear.com), [Kylotonn](https://www.kylotonn.com), [Next Level Games](https://www.nextlevelgames.com), [RAD Game Tools](http://www.radgametools.com/), [O-Net Communications (USA)](http://en.o-netcom.com), [Supercell](https://supercell.com), [Ubisoft](https://montreal.ubisoft.com/en/ubisoft-sponsors-user-interface-library-for-c-dear-imgui)
|
||||
*Double-chocolate sponsors*
|
||||
- [Google](https://github.com/google/filament), [Nvidia](https://developer.nvidia.com/nvidia-omniverse), [Ubisoft](https://montreal.ubisoft.com/en/ubisoft-sponsors-user-interface-library-for-c-dear-imgui)
|
||||
|
||||
*Chocolate sponsors*
|
||||
- [Activision](https://careers.activision.com/c/programmingsoftware-engineering-jobs), [Adobe](https://www.adobe.com/products/medium.html), [Aras Pranckevičius](https://aras-p.info), [Arkane Studios](https://www.arkane-studios.com), [Epic](https://www.unrealengine.com/en-US/megagrants), [RAD Game Tools](http://www.radgametools.com/)
|
||||
|
||||
*Salty-caramel sponsors*
|
||||
- [Framefield](http://framefield.com), [Grinding Gear Games](https://www.grindinggear.com), [Kylotonn](https://www.kylotonn.com), [Next Level Games](https://www.nextlevelgames.com), [O-Net Communications (USA)](http://en.o-netcom.com), [Supercell](https://supercell.com).
|
||||
|
||||
Please see [detailed list of Dear ImGui supporters](https://github.com/ocornut/imgui/wiki/Sponsors) for past sponsors.
|
||||
From November 2014 to December 2019, ongoing development has also been financially supported by its users on Patreon and through individual donations.
|
||||
|
@ -60,7 +60,7 @@ int main(int, char**)
|
||||
if (window == NULL)
|
||||
return 1;
|
||||
|
||||
id <MTLDevice> device = MTLCreateSystemDefaultDevice();;
|
||||
id <MTLDevice> device = MTLCreateSystemDefaultDevice();
|
||||
id <MTLCommandQueue> commandQueue = [device newCommandQueue];
|
||||
|
||||
// Setup Platform/Renderer backends
|
||||
|
43
imgui.cpp
43
imgui.cpp
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.84 WIP
|
||||
// dear imgui, v1.84
|
||||
// (main code and documentation)
|
||||
|
||||
// Help:
|
||||
@ -11,7 +11,7 @@
|
||||
// - FAQ http://dearimgui.org/faq
|
||||
// - Homepage & latest https://github.com/ocornut/imgui
|
||||
// - Releases & changelog https://github.com/ocornut/imgui/releases
|
||||
// - Gallery https://github.com/ocornut/imgui/issues/3793 (please post your screenshots/video there!)
|
||||
// - Gallery https://github.com/ocornut/imgui/issues/4451 (please post your screenshots/video there!)
|
||||
// - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there)
|
||||
// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
|
||||
// - Issues & support https://github.com/ocornut/imgui/issues
|
||||
@ -1013,7 +1013,8 @@ static void* GImAllocatorUserData = NULL;
|
||||
|
||||
ImGuiStyle::ImGuiStyle()
|
||||
{
|
||||
Alpha = 1.0f; // Global alpha applies to everything in ImGui
|
||||
Alpha = 1.0f; // Global alpha applies to everything in Dear ImGui.
|
||||
DisabledAlpha = 0.60f; // Additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha.
|
||||
WindowPadding = ImVec2(8,8); // Padding within a window
|
||||
WindowRounding = 0.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended.
|
||||
WindowBorderSize = 1.0f; // Thickness of border around windows. Generally set to 0.0f or 1.0f. Other values not well tested.
|
||||
@ -2574,6 +2575,7 @@ static const ImGuiCol GWindowDockStyleColors[ImGuiWindowDockStyleCol_COUNT] =
|
||||
static const ImGuiStyleVarInfo GStyleVarInfo[] =
|
||||
{
|
||||
{ ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, Alpha) }, // ImGuiStyleVar_Alpha
|
||||
{ ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, DisabledAlpha) }, // ImGuiStyleVar_DisabledAlpha
|
||||
{ ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowPadding) }, // ImGuiStyleVar_WindowPadding
|
||||
{ ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowRounding) }, // ImGuiStyleVar_WindowRounding
|
||||
{ ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowBorderSize) }, // ImGuiStyleVar_WindowBorderSize
|
||||
@ -7159,29 +7161,36 @@ void ImGui::PopItemFlag()
|
||||
g.CurrentItemFlags = g.ItemFlagsStack.back();
|
||||
}
|
||||
|
||||
// PushDisabled()/PopDisabled()
|
||||
// - Those can be nested but this cannot be used to enable an already disabled section (a single PushDisabled(true) in the stack is enough to keep things disabled)
|
||||
// - Those are not yet exposed in imgui.h because we are unsure of how to alter the style in a way that works for everyone.
|
||||
// We may rework this. Hypothetically, a future styling system may set a flag which make widgets use different colors.
|
||||
// BeginDisabled()/EndDisabled()
|
||||
// - Those can be nested but this cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep things disabled)
|
||||
// - Visually this is currently altering alpha, but it is expected that in a future styling system this would work differently.
|
||||
// - Feedback welcome at https://github.com/ocornut/imgui/issues/211
|
||||
// - You may trivially implement your own variation of this if needed.
|
||||
// Here we test (CurrentItemFlags & ImGuiItemFlags_Disabled) to allow nested PushDisabled() calls.
|
||||
void ImGui::PushDisabled(bool disabled)
|
||||
// - BeginDisabled(false) essentially does nothing but is provided to facilitate use of boolean expressions
|
||||
// - Optimized shortcuts instead of PushStyleVar() + PushItemFlag()
|
||||
void ImGui::BeginDisabled(bool disabled)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
bool was_disabled = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0;
|
||||
if (!was_disabled && disabled)
|
||||
PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * 0.6f);
|
||||
PushItemFlag(ImGuiItemFlags_Disabled, was_disabled || disabled);
|
||||
{
|
||||
//PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * g.Style.DisabledAlpha);
|
||||
g.DisabledAlphaBackup = g.Style.Alpha;
|
||||
g.Style.Alpha *= g.Style.DisabledAlpha;
|
||||
}
|
||||
//PushItemFlag(ImGuiItemFlags_Disabled, was_disabled || disabled);
|
||||
g.CurrentItemFlags |= ImGuiItemFlags_Disabled;
|
||||
g.ItemFlagsStack.push_back(g.CurrentItemFlags);
|
||||
}
|
||||
|
||||
void ImGui::PopDisabled()
|
||||
void ImGui::EndDisabled()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
bool was_disabled = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0;
|
||||
PopItemFlag();
|
||||
//PopItemFlag();
|
||||
g.ItemFlagsStack.pop_back();
|
||||
g.CurrentItemFlags &= ~ImGuiItemFlags_Disabled;
|
||||
if (was_disabled && (g.CurrentItemFlags & ImGuiItemFlags_Disabled) == 0)
|
||||
PopStyleVar();
|
||||
g.Style.Alpha = g.DisabledAlphaBackup; //PopStyleVar();
|
||||
}
|
||||
|
||||
// FIXME: Look into renaming this once we have settled the new Focus/Activation/TabStop system.
|
||||
@ -16778,7 +16787,7 @@ static void DebugNodeDockNodeFlags(ImGuiDockNodeFlags* p_flags, const char* labe
|
||||
PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f));
|
||||
Text("%s:", label);
|
||||
if (!enabled)
|
||||
PushDisabled();
|
||||
BeginDisabled();
|
||||
CheckboxFlags("NoSplit", p_flags, ImGuiDockNodeFlags_NoSplit);
|
||||
CheckboxFlags("NoResize", p_flags, ImGuiDockNodeFlags_NoResize);
|
||||
CheckboxFlags("NoResizeX", p_flags, ImGuiDockNodeFlags_NoResizeX);
|
||||
@ -16794,7 +16803,7 @@ static void DebugNodeDockNodeFlags(ImGuiDockNodeFlags* p_flags, const char* labe
|
||||
CheckboxFlags("NoDockingOverOther", p_flags, ImGuiDockNodeFlags_NoDockingOverOther);
|
||||
CheckboxFlags("NoDockingOverEmpty", p_flags, ImGuiDockNodeFlags_NoDockingOverEmpty);
|
||||
if (!enabled)
|
||||
PopDisabled();
|
||||
EndDisabled();
|
||||
PopStyleVar();
|
||||
PopID();
|
||||
}
|
||||
|
15
imgui.h
15
imgui.h
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.84 WIP
|
||||
// dear imgui, v1.84
|
||||
// (headers)
|
||||
|
||||
// Help:
|
||||
@ -11,7 +11,7 @@
|
||||
// - FAQ http://dearimgui.org/faq
|
||||
// - Homepage & latest https://github.com/ocornut/imgui
|
||||
// - Releases & changelog https://github.com/ocornut/imgui/releases
|
||||
// - Gallery https://github.com/ocornut/imgui/issues/3793 (please post your screenshots/video there!)
|
||||
// - Gallery https://github.com/ocornut/imgui/issues/4451 (please post your screenshots/video there!)
|
||||
// - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there)
|
||||
// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
|
||||
// - Issues & support https://github.com/ocornut/imgui/issues
|
||||
@ -61,8 +61,8 @@ Index of this file:
|
||||
|
||||
// Version
|
||||
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
|
||||
#define IMGUI_VERSION "1.84 WIP"
|
||||
#define IMGUI_VERSION_NUM 18314
|
||||
#define IMGUI_VERSION "1.84"
|
||||
#define IMGUI_VERSION_NUM 18400
|
||||
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
|
||||
#define IMGUI_HAS_TABLE
|
||||
#define IMGUI_HAS_VIEWPORT // Viewport WIP branch
|
||||
@ -829,6 +829,11 @@ namespace ImGui
|
||||
IMGUI_API void EndDragDropTarget(); // only call EndDragDropTarget() if BeginDragDropTarget() returns true!
|
||||
IMGUI_API const ImGuiPayload* GetDragDropPayload(); // peek directly into the current payload from anywhere. may return NULL. use ImGuiPayload::IsDataType() to test for the payload type.
|
||||
|
||||
// Disabling [BETA API]
|
||||
// - Disable all user interactions and dim items visuals (applying style.DisabledAlpha over current colors)
|
||||
IMGUI_API void BeginDisabled(bool disabled = true);
|
||||
IMGUI_API void EndDisabled();
|
||||
|
||||
// Clipping
|
||||
// - Mouse hovering is affected by ImGui::PushClipRect() calls, unlike direct calls to ImDrawList::PushClipRect() which are render only.
|
||||
IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect);
|
||||
@ -1568,6 +1573,7 @@ enum ImGuiStyleVar_
|
||||
{
|
||||
// Enum name --------------------- // Member in ImGuiStyle structure (see ImGuiStyle for descriptions)
|
||||
ImGuiStyleVar_Alpha, // float Alpha
|
||||
ImGuiStyleVar_DisabledAlpha, // float DisabledAlpha
|
||||
ImGuiStyleVar_WindowPadding, // ImVec2 WindowPadding
|
||||
ImGuiStyleVar_WindowRounding, // float WindowRounding
|
||||
ImGuiStyleVar_WindowBorderSize, // float WindowBorderSize
|
||||
@ -1814,6 +1820,7 @@ IM_MSVC_RUNTIME_CHECKS_RESTORE
|
||||
struct ImGuiStyle
|
||||
{
|
||||
float Alpha; // Global alpha applies to everything in Dear ImGui.
|
||||
float DisabledAlpha; // Additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha.
|
||||
ImVec2 WindowPadding; // Padding within a window.
|
||||
float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended.
|
||||
float WindowBorderSize; // Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
|
||||
|
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.84 WIP
|
||||
// dear imgui, v1.84
|
||||
// (demo code)
|
||||
|
||||
// Help:
|
||||
@ -585,6 +585,10 @@ static void ShowDemoWindowWidgets()
|
||||
if (!ImGui::CollapsingHeader("Widgets"))
|
||||
return;
|
||||
|
||||
static bool disable_all = false; // The Checkbox for that is inside the "Disabled" section at the bottom
|
||||
if (disable_all)
|
||||
ImGui::BeginDisabled();
|
||||
|
||||
if (ImGui::TreeNode("Basic"))
|
||||
{
|
||||
static int clicked = 0;
|
||||
@ -2233,7 +2237,7 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Querying Status (Edited/Active/Focused/Hovered etc.)"))
|
||||
if (ImGui::TreeNode("Querying Status (Edited/Active/Hovered etc.)"))
|
||||
{
|
||||
// Select an item type
|
||||
const char* item_names[] =
|
||||
@ -2241,16 +2245,20 @@ static void ShowDemoWindowWidgets()
|
||||
"Text", "Button", "Button (w/ repeat)", "Checkbox", "SliderFloat", "InputText", "InputFloat",
|
||||
"InputFloat3", "ColorEdit4", "Selectable", "MenuItem", "TreeNode", "TreeNode (w/ double-click)", "Combo", "ListBox"
|
||||
};
|
||||
static int item_type = 1;
|
||||
static int item_type = 4;
|
||||
static bool item_disabled = false;
|
||||
ImGui::Combo("Item Type", &item_type, item_names, IM_ARRAYSIZE(item_names), IM_ARRAYSIZE(item_names));
|
||||
ImGui::SameLine();
|
||||
HelpMarker("Testing how various types of items are interacting with the IsItemXXX functions. Note that the bool return value of most ImGui function is generally equivalent to calling ImGui::IsItemHovered().");
|
||||
ImGui::Checkbox("Item Disabled", &item_disabled);
|
||||
|
||||
// Submit selected item item so we can query their status in the code following it.
|
||||
bool ret = false;
|
||||
static bool b = false;
|
||||
static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f };
|
||||
static char str[16] = {};
|
||||
if (item_disabled)
|
||||
ImGui::BeginDisabled(true);
|
||||
if (item_type == 0) { ImGui::Text("ITEM: Text"); } // Testing text items with no identifier/interaction
|
||||
if (item_type == 1) { ret = ImGui::Button("ITEM: Button"); } // Testing button
|
||||
if (item_type == 2) { ImGui::PushButtonRepeat(true); ret = ImGui::Button("ITEM: Button"); ImGui::PopButtonRepeat(); } // Testing button (with repeater)
|
||||
@ -2278,6 +2286,7 @@ static void ShowDemoWindowWidgets()
|
||||
"IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
|
||||
"IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
|
||||
"IsItemHovered(_AllowWhenOverlapped) = %d\n"
|
||||
"IsItemHovered(_AllowWhenDisabled) = %d\n"
|
||||
"IsItemHovered(_RectOnly) = %d\n"
|
||||
"IsItemActive() = %d\n"
|
||||
"IsItemEdited() = %d\n"
|
||||
@ -2296,6 +2305,7 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup),
|
||||
ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem),
|
||||
ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenOverlapped),
|
||||
ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled),
|
||||
ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly),
|
||||
ImGui::IsItemActive(),
|
||||
ImGui::IsItemEdited(),
|
||||
@ -2310,6 +2320,9 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::GetItemRectSize().x, ImGui::GetItemRectSize().y
|
||||
);
|
||||
|
||||
if (item_disabled)
|
||||
ImGui::EndDisabled();
|
||||
|
||||
static bool embed_all_inside_a_child_window = false;
|
||||
ImGui::Checkbox("Embed everything inside a child window (for additional testing)", &embed_all_inside_a_child_window);
|
||||
if (embed_all_inside_a_child_window)
|
||||
@ -2382,6 +2395,18 @@ static void ShowDemoWindowWidgets()
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
// Demonstrate BeginDisabled/EndDisabled using a checkbox located at the bottom of the section (which is a bit odd:
|
||||
// logically we'd have this checkbox at the top of the section, but we don't want this feature to steal that space)
|
||||
if (disable_all)
|
||||
ImGui::EndDisabled();
|
||||
|
||||
if (ImGui::TreeNode("Disable block"))
|
||||
{
|
||||
ImGui::Checkbox("Disable entire section above", &disable_all);
|
||||
ImGui::SameLine(); HelpMarker("Demonstrate using BeginDisabled()/EndDisabled() across this section.");
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
static void ShowDemoWindowLayout()
|
||||
@ -2451,7 +2476,7 @@ static void ShowDemoWindowLayout()
|
||||
// You can also call SetNextWindowPos() to position the child window. The parent window will effectively
|
||||
// layout from this position.
|
||||
// - Using ImGui::GetItemRectMin/Max() to query the "item" state (because the child window is an item from
|
||||
// the POV of the parent window). See 'Demo->Querying Status (Active/Focused/Hovered etc.)' for details.
|
||||
// the POV of the parent window). See 'Demo->Querying Status (Edited/Active/Hovered etc.)' for details.
|
||||
{
|
||||
static int offset_x = 0;
|
||||
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
|
||||
@ -6116,6 +6141,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
HelpMarker("When drawing circle primitives with \"num_segments == 0\" tesselation will be calculated automatically.");
|
||||
|
||||
ImGui::DragFloat("Global Alpha", &style.Alpha, 0.005f, 0.20f, 1.0f, "%.2f"); // Not exposing zero here so user doesn't "lose" the UI (zero alpha clips all widgets). But application code could have a toggle to switch between zero and non-zero.
|
||||
ImGui::DragFloat("Disabled Alpha", &style.DisabledAlpha, 0.005f, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); HelpMarker("Additional alpha multiplier for disabled items (multiply over current value of Alpha).");
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
ImGui::EndTabItem();
|
||||
|
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.84 WIP
|
||||
// dear imgui, v1.84
|
||||
// (drawing and font code)
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.84 WIP
|
||||
// dear imgui, v1.84
|
||||
// (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!
|
||||
@ -754,7 +754,7 @@ enum ImGuiItemFlags_
|
||||
ImGuiItemFlags_None = 0,
|
||||
ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing (FIXME: should merge with _NoNav)
|
||||
ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
|
||||
ImGuiItemFlags_Disabled = 1 << 2, // false // Disable interactions but doesn't affect visuals. See PushDisabled()/PushDisabled(). See github.com/ocornut/imgui/issues/211
|
||||
ImGuiItemFlags_Disabled = 1 << 2, // false // Disable interactions but doesn't affect visuals. See BeginDisabled()/EndDisabled(). See github.com/ocornut/imgui/issues/211
|
||||
ImGuiItemFlags_NoNav = 1 << 3, // false // Disable keyboard/gamepad directional navigation (FIXME: should merge with _NoTabStop)
|
||||
ImGuiItemFlags_NoNavDefaultFocus = 1 << 4, // false // Disable item being a candidate for default focus (e.g. used by title bar items)
|
||||
ImGuiItemFlags_SelectableDontClosePopup = 1 << 5, // false // Disable MenuItem/Selectable() automatically closing their popup window
|
||||
@ -817,7 +817,7 @@ enum ImGuiButtonFlagsPrivate_
|
||||
ImGuiButtonFlags_FlattenChildren = 1 << 11, // allow interactions even if a child window is overlapping
|
||||
ImGuiButtonFlags_AllowItemOverlap = 1 << 12, // require previous frame HoveredId to either match id or be null before being usable, use along with SetItemAllowOverlap()
|
||||
ImGuiButtonFlags_DontClosePopups = 1 << 13, // disable automatically closing parent popup on press // [UNUSED]
|
||||
//ImGuiButtonFlags_Disabled = 1 << 14, // disable interactions -> use PushDisabled() or ImGuiItemFlags_Disabled
|
||||
//ImGuiButtonFlags_Disabled = 1 << 14, // disable interactions -> use BeginDisabled() or ImGuiItemFlags_Disabled
|
||||
ImGuiButtonFlags_AlignTextBaseLine = 1 << 15, // vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine
|
||||
ImGuiButtonFlags_NoKeyModifiers = 1 << 16, // disable mouse interaction if a key modifier is held
|
||||
ImGuiButtonFlags_NoHoldingActiveId = 1 << 17, // don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only)
|
||||
@ -1795,6 +1795,7 @@ struct ImGuiContext
|
||||
bool DragCurrentAccumDirty;
|
||||
float DragCurrentAccum; // Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings
|
||||
float DragSpeedDefaultRatio; // If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
|
||||
float DisabledAlphaBackup; // Backup for style.Alpha for BeginDisabled()
|
||||
float ScrollbarClickDeltaToGrabCenter; // Distance between mouse and center of grab box, normalized in parent space. Use storage?
|
||||
int TooltipOverrideCount;
|
||||
float TooltipSlowDelay; // Time before slow tooltips appears (FIXME: This is temporary until we merge in tooltip timer+priority work)
|
||||
@ -1975,6 +1976,7 @@ struct ImGuiContext
|
||||
DragCurrentAccumDirty = false;
|
||||
DragCurrentAccum = 0.0f;
|
||||
DragSpeedDefaultRatio = 1.0f / 100.0f;
|
||||
DisabledAlphaBackup = 0.0f;
|
||||
ScrollbarClickDeltaToGrabCenter = 0.0f;
|
||||
TooltipOverrideCount = 0;
|
||||
TooltipSlowDelay = 0.50f;
|
||||
@ -2651,8 +2653,6 @@ namespace ImGui
|
||||
// Parameter stacks
|
||||
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled);
|
||||
IMGUI_API void PopItemFlag();
|
||||
IMGUI_API void PushDisabled(bool disabled = true);
|
||||
IMGUI_API void PopDisabled();
|
||||
|
||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
// If you have old/custom copy-and-pasted widgets that used FocusableItemRegister():
|
||||
|
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.84 WIP
|
||||
// dear imgui, v1.84
|
||||
// (tables and columns code)
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.84 WIP
|
||||
// dear imgui, v1.84
|
||||
// (widgets code)
|
||||
|
||||
/*
|
||||
@ -3445,7 +3445,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
|
||||
style.FramePadding.x = style.FramePadding.y;
|
||||
ImGuiButtonFlags button_flags = ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups;
|
||||
if (flags & ImGuiInputTextFlags_ReadOnly)
|
||||
PushDisabled(true);
|
||||
BeginDisabled(true);
|
||||
SameLine(0, style.ItemInnerSpacing.x);
|
||||
if (ButtonEx("-", ImVec2(button_size, button_size), button_flags))
|
||||
{
|
||||
@ -3459,7 +3459,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
|
||||
value_changed = true;
|
||||
}
|
||||
if (flags & ImGuiInputTextFlags_ReadOnly)
|
||||
PopDisabled();
|
||||
EndDisabled();
|
||||
|
||||
const char* label_end = FindRenderedTextEnd(label);
|
||||
if (label != label_end)
|
||||
@ -6172,7 +6172,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
|
||||
|
||||
const bool disabled_global = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0;
|
||||
if (disabled_item && !disabled_global) // Only testing this as an optimization
|
||||
PushDisabled(true);
|
||||
BeginDisabled(true);
|
||||
|
||||
// FIXME: We can standardize the behavior of those two, we could also keep the fast path of override ClipRect + full push on render only,
|
||||
// which would be advantageous since most selectable are not selected.
|
||||
@ -6245,10 +6245,10 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
|
||||
CloseCurrentPopup();
|
||||
|
||||
if (disabled_item && !disabled_global)
|
||||
PopDisabled();
|
||||
EndDisabled();
|
||||
|
||||
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);
|
||||
return pressed;
|
||||
return pressed; //-V1020
|
||||
}
|
||||
|
||||
bool ImGui::Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags, const ImVec2& size_arg)
|
||||
@ -6841,7 +6841,7 @@ bool ImGui::BeginMenu(const char* label, bool enabled)
|
||||
ImVec2 popup_pos, pos = window->DC.CursorPos;
|
||||
PushID(label);
|
||||
if (!enabled)
|
||||
PushDisabled();
|
||||
BeginDisabled();
|
||||
const ImGuiMenuColumns* offsets = &window->DC.MenuColumns;
|
||||
if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
|
||||
{
|
||||
@ -6874,7 +6874,7 @@ bool ImGui::BeginMenu(const char* label, bool enabled)
|
||||
RenderArrow(window->DrawList, pos + ImVec2(offsets->OffsetMark + extra_w + g.FontSize * 0.30f, 0.0f), GetColorU32(ImGuiCol_Text), ImGuiDir_Right);
|
||||
}
|
||||
if (!enabled)
|
||||
PopDisabled();
|
||||
EndDisabled();
|
||||
|
||||
const bool hovered = (g.HoveredId == id) && enabled;
|
||||
if (menuset_is_open)
|
||||
@ -7007,7 +7007,7 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut
|
||||
bool pressed;
|
||||
PushID(label);
|
||||
if (!enabled)
|
||||
PushDisabled(true);
|
||||
BeginDisabled(true);
|
||||
const ImGuiSelectableFlags flags = ImGuiSelectableFlags_SelectOnRelease | ImGuiSelectableFlags_SetNavIdOnHover;
|
||||
const ImGuiMenuColumns* offsets = &window->DC.MenuColumns;
|
||||
if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
|
||||
@ -7047,7 +7047,7 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut
|
||||
}
|
||||
IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (selected ? ImGuiItemStatusFlags_Checked : 0));
|
||||
if (!enabled)
|
||||
PopDisabled();
|
||||
EndDisabled();
|
||||
PopID();
|
||||
|
||||
return pressed;
|
||||
|
Loading…
Reference in New Issue
Block a user