You may use the Issue Tracker to submit bug reports, feature requests or suggestions. You may ask for help or advice as well. However please read this wall of text before doing so. The amount of incomplete or ambiguous requests due to people not following those guidelines is often overwhelming. Please do your best to clarify your request. Thank you!
**IF YOU ARE HAVING AN ISSUE COMPILING/LINKING/RUNNING/DISPLAYING/ADDING FONTS/WIRING INPUTS**
- Please post on the "Getting Started" Discourse forum: https://discourse.dearimgui.org/c/getting-started
**Prerequisites for new users of dear imgui:**
- Please read the FAQ in imgui.cpp.
- Please read misc/fonts/README.txt if your question relates to fonts or text.
- Please run ImGui::ShowDemoWindow() to explore the demo and its sources.
- Please use the Search function of GitHub to look for similar issues. You may also browse issues by tags.
- Please use the Search function of your IDE to search in the code for comments related to your situation.
- If you get a assert, use a debugger to locate the line triggering it and read the comments around the assert.
**Guidelines to report an issue or ask a question:**
- Please provide your imgui version number.
- Please state if you have made substantial modifications to your copy of imgui.
- Try to be explicit with your Goals, your Expectations and what you have Tried. What you have in mind or in your code is not obvious to other people. People frequently discuss problems without first mentioning their goal.
- If you are discussing an assert or a crash, please provide a debugger callstack. Never state "it crashes" without additional information. If you don't know how to use a debugger and retrieve a callstack, learning about it will be useful.
- Please make sure that your compilation settings have asserts enabled. Calls to IM_ASSERT() are scattered in the code to help catch common issues. By default IM_ASSERT() calls the standard assert() function. To verify that your asserts are enabled, add the line `IM_ASSERT(false);` in your main() function. Your application should display an error message and abort. If your application report an error, it means that your asserts are disabled. Please make sure they are enabled.
- When discussing issues related to rendering or inputs, please state the OS/back-end/renderer you are using. Please state if you are using a vanilla copy of the example back-ends (imgui_impl_XXX files), or a modified one, or if you built your own.
- Please provide a Minimal, Complete and Verifiable Example ([MCVE](https://stackoverflow.com/help/mcve)) to demonstrate your problem. An ideal submission includes a small piece of code that anyone can paste in one of the examples/ application (e.g. in main.cpp or imgui_demo.cpp) to understand and reproduce it. Narrowing your problem to its shortest and purest form is the easiest way to understand it. Please test your shortened code to ensure it actually exhibit the problem. Often while creating the MCVE you will end up solving the problem! Many questions that are missing a standalone verifiable example are missing the actual cause of their issue in the description, which ends up wasting everyone's time.
- Try to attach screenshots to clarify the context. They often convey useful information that are omitted by the description. You can drag pictures/files here (prefer github attachments over 3rd party hosting).
- When requesting a new feature, please describe the usage context (how you intend to use it, why you need it, etc.).
**Some unfortunate words of warning**
- If you are or were involved in cheating schemes (e.g. DLL injection) for competitive online multi-player games, please don't post here. We won't answer and you will be blocked. We've had too many of you.
- Due to frequent abuse of this service from aforementioned users, if your GitHub account is anonymous and was created five minutes ago please understand that your post will receive more scrutiny and incomplete questions may be dismissed.
If you have been using dear imgui for a while or have been using C/C++ for several years or have demonstrated good behavior here, it is ok to not fullfill every item to the letter. Those are guidelines and experienced users or members of the community will know which information are useful in a given context.
## How to create an Pull Request
- Please understand that by submitting a PR you are also submitting a request for the maintainer to review your code and then take over its maintenance forever. PR should be crafted both in the interest in the end-users and also to ease the maintainer into understanding and accepting it.
- When adding a feature, please describe the usage context (how you intend to use it, why you need it, etc.).
- When fixing a warning or compilation problem, please post the compiler log and specify the version and OS you are using.
- Try to attach screenshots to clarify the context and demonstrate the feature at a glance. You can drag pictures/files here (prefer github attachments over 3rd party hosting).
- Make sure your code follows the coding style already used in imgui (spaces instead of tabs, "local_variable", "FunctionName", "MemberName", etc.). We don't use modern C++ idioms and can compile without C++11.
- Make sure you create a branch for the pull request. In Git, 1 PR is associated to 1 branch. If you keep pushing to the same branch after you submitted the PR, your new commits will appear in the PR (we can still cherry-pick individual commits).
(Click "Preview" to turn any http URL into a clickable link)
(Click "Preview" to turn any http URL into a clickable link)
1. IF YOU ARE HAVING AN ISSUE COMPILING/LINKING/RUNNING/DISPLAYING/ADDING FONTS/WIRING INPUTS, please post on the "Getting Started" Discourse forum:
1. PLEASE CAREFULLY READ:
https://discourse.dearimgui.org/c/getting-started
https://github.com/ocornut/imgui/issues/2261
2. You may use this Issue Tracker to ask for help and submit bug reports, feature requests or suggestions that don't fit in any category of (1). PLEASE CAREFULLY READ THE CONTRIBUTING DOCUMENT before submitting any issue: https://github.com/ocornut/imgui/blob/master/.github/CONTRIBUTING.md
2. IF YOU ARE HAVING AN ISSUE COMPILING/LINKING/RUNNING/DISPLAYING/ADDING FONTS, please post on the "Getting Started" Discourse forum:
https://discourse.dearimgui.org/c/getting-started
3. PLEASE MAKE SURE that you have: read the FAQ in imgui.cpp; explored the contents of ShowDemoWindow() including the Examples menu; searched among Issues; used your IDE to search for keywords in all sources and text files; and read the CONTRIBUTING.md file linked above.
3. PLEASE MAKE SURE that you have: read the FAQ in imgui.cpp; explored the contents of ShowDemoWindow() including the Examples menu; searched among Issues; used your IDE to search for keywords in all sources and text files; and read the link provided in (1).
4. Delete points 1-4 and PLEASE FILL THE TEMPLATE BELOW before submitting your issue.
4. Delete points 1-4 and PLEASE FILL THE TEMPLATE BELOW before submitting your issue.
(Click "Preview" to turn any http URL into a clickable link)
- Please understand that by submitting a PR you are also submitting a request for the maintainer to review your code and then take over its maintenance forever. PR should be crafted both in the interest in the end-users and also to ease the maintainer into understanding and accepting it.
- When adding a feature, please describe the usage context (how you intend to use it, why you need it, etc.).
1. PLEASE CAREFULLY READ:
- When adding a feature, try to attach screenshots/gifs to clarify the context and demonstrate the feature at a glance.
https://github.com/ocornut/imgui/issues/2261
- When fixing a warning or compilation problem, post the compiler log and specify the version and OS you are using.
- Make sure your code follows the coding style already used in the codebase (4 spaces identation, no tabs, `type* name`, `local_variable`, `FunctionName()`, `MemberName`, `// Text Comment`, `//CodeComment()`, etc.). We don't use modern C++ idioms, we don't use C++ style cast, we don't use C++ headers, and we can compile without a C++11 compatible compiler.
2. PLEASE MAKE SURE YOU HAVE READ:
- Make sure you create a branch for the pull request. In Git, 1 PR is associated to 1 branch. If you keep pushing to the same branch after you submitted the PR, your new commits will appear in the PR.
IM_ASSERT(io.Fonts->IsBuilt());// Font atlas needs to be built, call renderer _NewFrame() function e.g. ImGui_ImplOpenGL3_NewFrame()
IM_ASSERT(io.Fonts->IsBuilt()&&"Font atlas not built! It is generally built by the renderer back-end. Missing call to renderer _NewFrame() function? e.g. ImGui_ImplOpenGL3_NewFrame().");
// Setup display size
// Setup display size (every frame to accommodate for window resizing)
IM_ASSERT(io.Fonts->IsBuilt());// Font atlas needs to be built, call renderer _NewFrame() function e.g. ImGui_ImplOpenGL3_NewFrame()
IM_ASSERT(io.Fonts->IsBuilt()&&"Font atlas not built! It is generally built by the renderer back-end. Missing call to renderer _NewFrame() function? e.g. ImGui_ImplOpenGL3_NewFrame().");
// Setup display size (every frame to accommodate for window resizing)
// Setup display size (every frame to accommodate for window resizing)
// - This is _ignoring_ viewports with the ImGuiViewportFlags_NoInputs flag (pass-through windows).
// - This is _ignoring_ viewports with the ImGuiViewportFlags_NoInputs flag (pass-through windows).
// - This is _regardless_ of whether another viewport is focused or being dragged from.
// - This is _regardless_ of whether another viewport is focused or being dragged from.
// If ImGuiBackendFlags_HasMouseHoveredViewport is not set by the back-end, imgui will ignore this field and infer the information by relying on the
// If ImGuiBackendFlags_HasMouseHoveredViewport is not set by the back-end, imgui will ignore this field and infer the information by relying on the
// rectangles and last focused time of every viewports it knows about. It will be unaware of other windows that may be sitting between or over your windows.
// rectangles and last focused time of every viewports it knows about. It will be unaware of foreign windows that may be sitting between or over your windows.
if((viewport->Flags&ImGuiViewportFlags_NoInputs)==0)// FIXME: We still get our NoInputs window with WM_NCHITTEST/HTTRANSPARENT code when decorated?
io.MouseHoveredViewport=viewport->ID;
}
}
voidImGui_ImplWin32_NewFrame()
voidImGui_ImplWin32_NewFrame()
{
{
ImGuiIO&io=ImGui::GetIO();
ImGuiIO&io=ImGui::GetIO();
IM_ASSERT(io.Fonts->IsBuilt()&&"Font atlas not built! It is generally built by the renderer back-end. Missing call to renderer _NewFrame() function? e.g. ImGui_ImplOpenGL3_NewFrame().");
// Setup display size (every frame to accommodate for window resizing)
// Setup display size (every frame to accommodate for window resizing)
constImGuiIDIMGUI_VIEWPORT_DEFAULT_ID=0x11111111;// Using an arbitrary constant instead of e.g. ImHash("ViewportDefault", 0); so it's easier to spot in the debugger. The exact value doesn't matter.
constImGuiIDIMGUI_VIEWPORT_DEFAULT_ID=0x11111111;// Using an arbitrary constant instead of e.g. ImHash("ViewportDefault", 0); so it's easier to spot in the debugger. The exact value doesn't matter.
// Render. If user hasn't set a callback then they may retrieve the draw data via GetDrawData()
// (Legacy) Call the Render callback function. The current prefer way is to let the user retrieve GetDrawData() and call the render function themselves.
// Attempt to restore saved viewport id (= window that hasn't been activated yet), try to restore the viewport based on saved 'window->ViewportPos' restored from .ini file
// Attempt to restore saved viewport id (= window that hasn't been activated yet), try to restore the viewport based on saved 'window->ViewportPos' restored from .ini file
// Optional, general purpose call to allow the back-end to perform general book-keeping even if things haven't changed.
if(g.PlatformIO.Platform_UpdateWindow)
g.PlatformIO.Platform_UpdateWindow(viewport);
if(is_new_platform_window)
if(is_new_platform_window)
{
{
// On startup ensure new platform window don't steal focus (give it a few frames, as nested contents may lead to viewport being created a few frames late)
// On startup ensure new platform window don't steal focus (give it a few frames, as nested contents may lead to viewport being created a few frames late)
// Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code.
// Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code.
// Read 'Programmer guide' in imgui.cpp for notes on how to setup ImGui in your codebase.
// Newcomers, read 'Programmer guide' below for notes on how to setup Dear ImGui in your codebase.
// Get latest version at https://github.com/ocornut/imgui
// Get latest version at https://github.com/ocornut/imgui
/*
/*
@ -97,12 +97,11 @@ struct ImDrawVert; // A single vertex (20 bytes by default, ove
structImFont;// Runtime data for a single font within a parent ImFontAtlas
structImFont;// Runtime data for a single font within a parent ImFontAtlas
structImFontAtlas;// Runtime data for multiple fonts, bake multiple fonts into a single texture, TTF/OTF font loader
structImFontAtlas;// Runtime data for multiple fonts, bake multiple fonts into a single texture, TTF/OTF font loader
structImFontConfig;// Configuration data when adding a font or merging fonts
structImFontConfig;// Configuration data when adding a font or merging fonts
structImColor;// Helper functions to create a color that can be converted to either u32 or float4 (*obsolete* please avoid using)
structImColor;// Helper functions to create a color that can be converted to either u32 or float4 (*OBSOLETE* please avoid using)
#ifndef ImTextureID
#ifndef ImTextureID
typedefvoid*ImTextureID;// User data to identify a texture (this is whatever to you want it to be! read the FAQ about ImTextureID in imgui.cpp)
typedefvoid*ImTextureID;// User data to identify a texture (this is whatever to you want it to be! read the FAQ about ImTextureID in imgui.cpp)
#endif
#endif
structImGuiContext;// ImGui context (opaque)
structImGuiContext;// Dear ImGui context (opaque structure, unless including imgui_internal.h)
structImGuiWindowClass;// Window class/family for docking filtering or high-level identifiation of windows by user
structImGuiIO;// Main configuration and I/O between your application and ImGui
structImGuiIO;// Main configuration and I/O between your application and ImGui
structImGuiInputTextCallbackData;// Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use)
structImGuiInputTextCallbackData;// Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use)
structImGuiListClipper;// Helper to manually clip large list of items
structImGuiListClipper;// Helper to manually clip large list of items
@ -116,11 +115,12 @@ struct ImGuiStyle; // Runtime data for styling/colors
structImGuiTextFilter;// Helper to parse and apply text filters (e.g. "aaaaa[,bbbb][,ccccc]")
structImGuiTextFilter;// Helper to parse and apply text filters (e.g. "aaaaa[,bbbb][,ccccc]")
structImGuiTextBuffer;// Helper to hold and append into a text buffer (~string builder)
structImGuiTextBuffer;// Helper to hold and append into a text buffer (~string builder)
structImGuiViewport;// Viewport (generally ~1 per window to output to at the OS level. Need per-platform support to use multiple viewports)
structImGuiViewport;// Viewport (generally ~1 per window to output to at the OS level. Need per-platform support to use multiple viewports)
structImGuiWindowClass;// Window class (rare/advanced uses: provide hints to the platform back-end via altered viewport flags and parent/child info)
// Typedefs and Enums/Flags (declared as int for compatibility with old C++, to allow using as flags and to not pollute the top of this file)
// Typedefs and Enums/Flags (declared as int for compatibility with old C++, to allow using as flags and to not pollute the top of this file)
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
typedefunsignedintImGuiID;// Unique ID used by widgets (typically hashed from a stack of string)
typedefunsignedintImGuiID;// Unique ID used by widgets (typically hashed from a stack of string)
typedefunsignedshortImWchar;// Character for keyboard input/display
typedefunsignedshortImWchar;// A single U16 character for keyboard input/display. We encode them as multi bytes UTF-8 when used in strings.
typedefintImGuiCol;// -> enum ImGuiCol_ // Enum: A color identifier for styling
typedefintImGuiCol;// -> enum ImGuiCol_ // Enum: A color identifier for styling
typedefintImGuiCond;// -> enum ImGuiCond_ // Enum: A condition for Set*()
typedefintImGuiCond;// -> enum ImGuiCond_ // Enum: A condition for Set*()
typedefintImGuiDataType;// -> enum ImGuiDataType_ // Enum: A primary data type
typedefintImGuiDataType;// -> enum ImGuiDataType_ // Enum: A primary data type
@ -279,6 +279,7 @@ namespace ImGui
IMGUI_APIvoidSetNextWindowFocus();// set next window to be focused / front-most. call before Begin()
IMGUI_APIvoidSetNextWindowFocus();// set next window to be focused / front-most. call before Begin()
IMGUI_APIvoidSetNextWindowBgAlpha(floatalpha);// set next window background color alpha. helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground.
IMGUI_APIvoidSetNextWindowBgAlpha(floatalpha);// set next window background color alpha. helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground.
IMGUI_APIvoidSetNextWindowViewport(ImGuiIDviewport_id);// set next window viewport
IMGUI_APIvoidSetNextWindowViewport(ImGuiIDviewport_id);// set next window viewport
IMGUI_APIvoidSetNextWindowClass(constImGuiWindowClass*window_class);// set next window class (rare/advanced uses: provide hints to the platform back-end via altered viewport flags and parent/child info)
IMGUI_APIvoidSetWindowPos(constImVec2&pos,ImGuiCondcond=0);// (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
IMGUI_APIvoidSetWindowPos(constImVec2&pos,ImGuiCondcond=0);// (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
IMGUI_APIvoidSetWindowSize(constImVec2&size,ImGuiCondcond=0);// (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0,0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects.
IMGUI_APIvoidSetWindowSize(constImVec2&size,ImGuiCondcond=0);// (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0,0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects.
IMGUI_APIvoidSetWindowCollapsed(boolcollapsed,ImGuiCondcond=0);// (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().
IMGUI_APIvoidSetWindowCollapsed(boolcollapsed,ImGuiCondcond=0);// (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().
@ -446,19 +447,20 @@ namespace ImGui
// Widgets: Input with Keyboard
// Widgets: Input with Keyboard
// - If you want to use InputText() with a dynamic string type such as std::string or your own, see misc/cpp/imgui_stdlib.h
// - If you want to use InputText() with a dynamic string type such as std::string or your own, see misc/cpp/imgui_stdlib.h
// - Most of the ImGuiInputTextFlags flags are only useful for InputText() and not for InputFloatX, InputIntX, InputDouble etc.
// Widgets: Color Editor/Picker (tip: the ColorEdit* functions have a little colored preview square that can be left-clicked to open a picker, and right-clicked to open an option menu.)
// Widgets: Color Editor/Picker (tip: the ColorEdit* functions have a little colored preview square that can be left-clicked to open a picker, and right-clicked to open an option menu.)
// - Note that in C++ a 'float v[X]' function argument is the _same_ as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can the pass the address of a first float element out of a contiguous structure, e.g. &myvector.x
// - Note that in C++ a 'float v[X]' function argument is the _same_ as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can the pass the address of a first float element out of a contiguous structure, e.g. &myvector.x
@ -703,6 +705,7 @@ namespace ImGui
IMGUI_APIvoidUpdatePlatformWindows();// call in main loop. will call CreateWindow/ResizeWindow/etc. platform functions for each secondary viewport, and DestroyWindow for each inactive viewport.
IMGUI_APIvoidUpdatePlatformWindows();// call in main loop. will call CreateWindow/ResizeWindow/etc. platform functions for each secondary viewport, and DestroyWindow for each inactive viewport.
IMGUI_APIvoidRenderPlatformWindowsDefault(void*platform_arg=NULL,void*renderer_arg=NULL);// call in main loop. will call RenderWindow/SwapBuffers platform functions for each secondary viewport. may be reimplemented by user for custom rendering needs.
IMGUI_APIvoidRenderPlatformWindowsDefault(void*platform_arg=NULL,void*renderer_arg=NULL);// call in main loop. will call RenderWindow/SwapBuffers platform functions for each secondary viewport. may be reimplemented by user for custom rendering needs.
IMGUI_APIvoidDestroyPlatformWindows();// call DestroyWindow platform functions for all viewports. call from back-end Shutdown() if you need to close platform windows before imgui shutdown. otherwise will be called by DestroyContext().
IMGUI_APIvoidDestroyPlatformWindows();// call DestroyWindow platform functions for all viewports. call from back-end Shutdown() if you need to close platform windows before imgui shutdown. otherwise will be called by DestroyContext().
IMGUI_APIImGuiViewport*FindViewportByID(ImGuiIDid);// this is a helper for back-ends.
IMGUI_APIImGuiViewport*FindViewportByPlatformHandle(void*platform_handle);// this is a helper for back-ends. the type platform_handle is decided by the back-end (e.g. HWND, MyWindow*, GLFWwindow* etc.)
IMGUI_APIImGuiViewport*FindViewportByPlatformHandle(void*platform_handle);// this is a helper for back-ends. the type platform_handle is decided by the back-end (e.g. HWND, MyWindow*, GLFWwindow* etc.)
}// namespace ImGui
}// namespace ImGui
@ -1023,8 +1026,8 @@ enum ImGuiConfigFlags_
// When using viewports it is recommended that your default value for ImGuiCol_WindowBg is opaque (Alpha=1.0) so transition to a viewport won't be noticeable.
// When using viewports it is recommended that your default value for ImGuiCol_WindowBg is opaque (Alpha=1.0) so transition to a viewport won't be noticeable.
ImGuiConfigFlags_ViewportsEnable=1<<10,// Viewport enable flags (require both ImGuiConfigFlags_PlatformHasViewports + ImGuiConfigFlags_RendererHasViewports set by the respective back-ends)
ImGuiConfigFlags_ViewportsEnable=1<<10,// Viewport enable flags (require both ImGuiConfigFlags_PlatformHasViewports + ImGuiConfigFlags_RendererHasViewports set by the respective back-ends)
ImGuiConfigFlags_ViewportsNoTaskBarIcon=1<<11,// Disable task bars icons for all secondary viewports (will set ImGuiViewportFlags_NoTaskBarIcon on them)
ImGuiConfigFlags_ViewportsNoTaskBarIcon=1<<11,// Disable task bars icons for all secondary viewports (will set ImGuiViewportFlags_NoTaskBarIcon on them)
ImGuiConfigFlags_ViewportsNoMerge =1<<12,// All floating windows will always create their own viewport and platform window.
ImGuiConfigFlags_ViewportsDecoration =1<<12,// FIXME [Broken] Enable platform decoration for all secondary viewports (will not set ImGuiViewportFlags_NoDecoration on them). This currently doesn't behave well in Windows because 1) By default the new window animation get in the way of our transitions, 2) It enable a minimum window size which tends to breaks resizing. You can workaround the later by setting style.WindowMinSize to a bigger value.
ImGuiConfigFlags_ViewportsDecoration =1<<13,// FIXME [Broken] Enable platform decoration for all secondary viewports (will not set ImGuiViewportFlags_NoDecoration on them). This currently doesn't behave well in Windows because 1) By default the new window animation get in the way of our transitions, 2) It enable a minimum window size which tends to breaks resizing. You can workaround the later by setting style.WindowMinSize to a bigger value.
ImGuiConfigFlags_ViewportsNoMerge =1<<13,// All floating windows will always create their own viewport and platform window.
ImGuiConfigFlags_DpiEnableScaleViewports=1<<14,// FIXME-DPI: Reposition and resize imgui windows when the DpiScale of a viewport changed (mostly useful for the main viewport hosting other window). Note that resizing the main window itself is up to your application.
ImGuiConfigFlags_DpiEnableScaleViewports=1<<14,// FIXME-DPI: Reposition and resize imgui windows when the DpiScale of a viewport changed (mostly useful for the main viewport hosting other window). Note that resizing the main window itself is up to your application.
ImGuiConfigFlags_DpiEnableScaleFonts=1<<15,// FIXME-DPI: Request bitmap-scaled fonts to match DpiScale. This is a very low-quality workaround. The correct way to handle DPI is _currently_ to replace the atlas and/or fonts in the Platform_OnChangedViewport callback, but this is all early work in progress.
ImGuiConfigFlags_DpiEnableScaleFonts=1<<15,// FIXME-DPI: Request bitmap-scaled fonts to match DpiScale. This is a very low-quality workaround. The correct way to handle DPI is _currently_ to replace the atlas and/or fonts in the Platform_OnChangedViewport callback, but this is all early work in progress.
@ -1470,13 +1473,17 @@ struct ImGuiPayload
boolIsDelivery()const{returnDelivery;}
boolIsDelivery()const{returnDelivery;}
};
};
// [BETA] Rarely used, very advanced uses only. Use with SetNextWindowClass() and DockSpace() functions.
// [BETA] Rarely used / very advanced uses only. Use with SetNextWindowClass() and DockSpace() functions.
// Provide hints to the platform back-end via altered viewport flags (enable/disable OS decoration, OS task bar icons, etc.) and OS level parent/child relationships.
structImGuiWindowClass
structImGuiWindowClass
{
{
ImGuiIDClassId;// User data. 0 = Default class (unclassed)
ImGuiIDClassId;// User data. 0 = Default class (unclassed)
boolDockingAllowUnclassed;// true = can be docked/merged with an unclassed window
ImGuiIDParentViewportId;// Hint for the platform back-end. If non-zero, the platform back-end can create a parent<>child relationship between the platform windows. Not conforming back-ends are free to e.g. parent every viewport to the main viewport or not.
ImGuiViewportFlagsViewportFlagsOverrideMask;// Viewport flags to override when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
ImGuiViewportFlagsViewportFlagsOverrideValue;// Viewport flags values to override when a window of this class owns a viewport.
boolDockingAllowUnclassed;// true = can be docked/merged with an unclassed window
IMGUI_APIboolInputFloat(constchar*label,float*v,floatstep,floatstep_fast,intdecimal_precision,ImGuiInputTextFlagsextra_flags =0);// Use the 'const char* format' version instead of 'decimal_precision'!
IMGUI_APIboolInputFloat(constchar*label,float*v,floatstep,floatstep_fast,intdecimal_precision,ImGuiInputTextFlags flags =0);// Use the 'const char* format' version instead of 'decimal_precision'!
void(*Platform_UpdateWindow)(ImGuiViewport*vp);// (Optional) Called in UpdatePlatforms(). Optional hook to allow the platform back-end from doing general book-keeping every frame.
void(*Platform_RenderWindow)(ImGuiViewport*vp,void*render_arg);// (Optional) Setup for render
void(*Platform_RenderWindow)(ImGuiViewport*vp,void*render_arg);// (Optional) Setup for render
float(*Platform_GetWindowDpiScale)(ImGuiViewport*vp);// (Optional) [BETA] (FIXME-DPI) DPI handling: Return DPI scale for this viewport. 1.0f = 96 DPI.
float(*Platform_GetWindowDpiScale)(ImGuiViewport*vp);// (Optional) [BETA] (FIXME-DPI) DPI handling: Return DPI scale for this viewport. 1.0f = 96 DPI.
@ -2266,11 +2274,11 @@ struct ImGuiPlatformIO
enumImGuiViewportFlags_
enumImGuiViewportFlags_
{
{
ImGuiViewportFlags_None=0,
ImGuiViewportFlags_None=0,
ImGuiViewportFlags_NoDecoration=1<<0,// Platform Window: Disable platform decorations: title bar, borders, etc.
ImGuiViewportFlags_NoDecoration=1<<0,// Platform Window: Disable platform decorations: title bar, borders, etc. (generally set all windows, but if ImGuiConfigFlags_ViewportsDecoration is set we only set this on popups/tooltips)
ImGuiViewportFlags_NoFocusOnAppearing =1<<1,// Platform Window: Don't take focus when created.
ImGuiViewportFlags_NoTaskBarIcon =1<<1,// Platform Window: Disable platform task bar icon (generally set on popups/tooltips, or all windows if ImGuiConfigFlags_ViewportsNoTaskBarIcon is set)
ImGuiViewportFlags_NoInputs =1<<2,// Platform Window: Make mouse pass through so we can drag this window while peaking behind it.
ImGuiViewportFlags_NoFocusOnAppearing =1<<2,// Platform Window: Don't take focus when created.
ImGuiViewportFlags_NoTaskBarIcon =1<<3,// Platform Window: Disable platform task bar icon (for popups, menus, or all windows if ImGuiConfigFlags_ViewportsNoTaskBarIcons if set)
ImGuiViewportFlags_NoInputs=1<<3,// Platform Window: Make mouse pass through so we can drag this window while peaking behind it.
ImGuiViewportFlags_NoRendererClear=1<<4,// Platform Window: Renderer doesn't need to clear the framebuffer ahead.
ImGuiViewportFlags_NoRendererClear=1<<4,// Platform Window: Renderer doesn't need to clear the framebuffer ahead (because we will fill it entirely).
ImGuiViewportFlags_TopMost=1<<5// Platform Window: Display on top (for tooltips only)
ImGuiViewportFlags_TopMost=1<<5// Platform Window: Display on top (for tooltips only)
};
};
@ -2283,6 +2291,7 @@ struct ImGuiViewport
ImVec2Size;// Size of viewport in pixel
ImVec2Size;// Size of viewport in pixel
floatDpiScale;// 1.0f = 96 DPI = No extra scale
floatDpiScale;// 1.0f = 96 DPI = No extra scale
ImDrawData*DrawData;// The ImDrawData corresponding to this viewport. Valid after Render() and until the next call to NewFrame().
ImDrawData*DrawData;// The ImDrawData corresponding to this viewport. Valid after Render() and until the next call to NewFrame().
ImGuiIDParentViewportId;// (Advanced) 0: no parent. Instruct the platform back-end to setup a parent/child relationship between platform windows.
void*RendererUserData;// void* to hold custom data structure for the renderer (e.g. swap chain, frame-buffers etc.)
void*RendererUserData;// void* to hold custom data structure for the renderer (e.g. swap chain, frame-buffers etc.)
void*PlatformUserData;// void* to hold custom data structure for the OS / platform (e.g. windowing info, render context)
void*PlatformUserData;// void* to hold custom data structure for the OS / platform (e.g. windowing info, render context)
@ -2291,7 +2300,7 @@ struct ImGuiViewport
boolPlatformRequestMove;// Platform window requested move (e.g. window was moved by the OS / host window manager, authoritative position will be OS window position)
boolPlatformRequestMove;// Platform window requested move (e.g. window was moved by the OS / host window manager, authoritative position will be OS window position)
boolPlatformRequestResize;// Platform window requested resize (e.g. window was resized by the OS / host window manager, authoritative size will be OS window size)
boolPlatformRequestResize;// Platform window requested resize (e.g. window was resized by the OS / host window manager, authoritative size will be OS window size)
ImGui::SameLine();ShowHelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n");
ImGui::SameLine();ShowHelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n");
// ImGuiViewport Private/Internals fields (cardinal sin: we are using inheritance!)
// ImGuiViewport Private/Internals fields (cardinal sin: we are using inheritance!)
// Note that every instance of ImGuiViewport is in fact a ImGuiViewportP.
structImGuiViewportP:publicImGuiViewport
structImGuiViewportP:publicImGuiViewport
{
{
intIdx;
intIdx;
@ -682,7 +683,7 @@ struct ImGuiViewportP : public ImGuiViewport
shortPlatformMonitor;
shortPlatformMonitor;
boolPlatformWindowCreated;
boolPlatformWindowCreated;
boolPlatformWindowMinimized;
boolPlatformWindowMinimized;
ImGuiWindow*Window;// Set when the viewport is owned by a window
ImGuiWindow*Window;// Set when the viewport is owned by a window (and ImGuiViewportFlags_CanHostOtherWindows is NOT set)
ImDrawList*OverlayDrawList;// For convenience, a draw list we can render to that's always rendered last (we use it to draw software mouse cursor when io.MouseDrawCursor is set)
ImDrawList*OverlayDrawList;// For convenience, a draw list we can render to that's always rendered last (we use it to draw software mouse cursor when io.MouseDrawCursor is set)
// Hexadecimal input provided as a convenience but the flag name is awkward. Typically you'd use InputText() to parse your own data, if you want to handle prefixes.
// Hexadecimal input provided as a convenience but the flag name is awkward. Typically you'd use InputText() to parse your own data, if you want to handle prefixes.