IO: Added BackendPlatformUserData, BackendRendererUserData, BackendLanguageUserData void* for storage use by back-ends. (#2004 + for cimgui)

This commit is contained in:
omar 2018-12-20 11:41:24 +01:00
parent 8399fb5071
commit 5691385a33
3 changed files with 9 additions and 4 deletions

View File

@ -60,6 +60,7 @@ Other Changes:
This affects clamping window within the visible area: with this option enabled title bars need to be visible. (#899)
- Window: Fixed using SetNextWindowPos() on a child window (which wasn't really documented) position the cursor as expected
in the parent window, so there is no mismatch between the layout in parent and the position of the child window.
- IO: Added BackendPlatformUserData, BackendRendererUserData, BackendLanguageUserData void* for storage use by back-ends.
- Style: Tweaked default value of style.DisplayWindowPadding from (20,20) to (19,19) so the default style as a value
which is the same as the title bar height.
- Demo: "Simple Layout" and "Style Editor" are now using tabs.

View File

@ -1111,6 +1111,7 @@ ImGuiIO::ImGuiIO()
// Platform Functions
BackendPlatformName = BackendRendererName = NULL;
BackendPlatformUserData = BackendRendererUserData = BackendLanguageUserData = NULL;
GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations
SetClipboardTextFn = SetClipboardTextFn_DefaultImpl;
ClipboardUserData = NULL;

View File

@ -1240,9 +1240,12 @@ struct ImGuiIO
// (the imgui_impl_xxxx back-end files are setting those up for you)
//------------------------------------------------------------------
// Optional: Platform/Renderer back-end name (informational only! will be displayed in About Window)
const char* BackendPlatformName;
const char* BackendRendererName;
// Optional: Platform/Renderer back-end name (informational only! will be displayed in About Window) + User data for back-end/wrappers to store their own stuff.
const char* BackendPlatformName; // = NULL
const char* BackendRendererName; // = NULL
void* BackendPlatformUserData; // = NULL
void* BackendRendererUserData; // = NULL
void* BackendLanguageUserData; // = NULL
// Optional: Access OS clipboard
// (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)