Commit Graph

23 Commits

Author SHA1 Message Date
WiggleWizard
b346fa894d Custom font support 2022-04-01 01:33:38 +01:00
Sebastian
d4ffe9443f Enforced IWYU-style PCH model:
- Removed explicit PCH.
- Fixed includes to compile for all supported engine versions, including non-unity builds.
- Configured build.cs to treat ImGui as an engine module and added stricter compilation rules.
2020-06-25 10:52:46 +01:00
Sebastian
04e6f9d844 Removed dependency on headers included in the PCH and fixed any non-unity issues. 2020-06-14 21:50:26 +01:00
Sebastian
9d4eb74bf0 Added support for DPI scaling in ImGui, with scaling in Slate remaining as an alternative:
- The old DPI Scale setting was replaced by DPI Scaling Info, which contains information about scale and method of scaling.
- ImGui Context Manager handles scaling in ImGui by scaling all styles, rebuilding fonts using a different size, and raising OnFontAtlasBuilt event.
- ImGui Module Manager uses OnFontAtlasBuilt event to rebuild font textures.
- The update policy in Texture Manager was loosened to update existing resources rather than throwing an exception. This is less strict but it is now more useful since our main texture can now change. The throwing behavior used in the public interface is now handled before calling to the Texture Manager.
2020-06-07 21:58:48 +01:00
Sebastian
003eed34d7 Added multi-PIE support to adaptive canvas size:
- Adaptive size is controlled by the ImGui Widget, which passes it from the view-port to the context proxy.
- Context only copies display size that is set from the outside.
- Removed feature dependency from the manager.
2020-04-16 15:36:29 +01:00
kkawachi
174e38cfc6
Acquire size of ImGUI canvas from game viewport (#27)
- WIP: Does not support multi-PIE. All instances get the same size.
- Setting to enable/disable adaptive size.
2020-04-16 13:08:32 +01:00
kkawachi
5e4b7084de Fixed build errors when the plugin is placed in the engine directory. (#19)
Merged 4 commits fixing build errors when compiling this as an engine plugin:
- Changed include directives to use full paths (ex. <ICursor.h> -> <GenericPlatform/ICursor.h>).
- Added categories to FImGuiKeyInfo properties (required for all blueprint exposed types in engine plugins).
- Added explicit configuration of PCHUsage (without that it is assumed to be UseExplicitOrSharedPCHs in engine plugins and UseSharedPCHs in game ones) - amended to work also in the older engine versions.
2019-07-27 18:45:25 +01:00
Sebastian
2d728f1f26 Removed from FImGuiModuleManager custom check for a game thread as both reasons to have it are not relevant any more.
Current implementation of the IsInGameThread() doesn't make exceptions for a loading thread and lazy initialization of the Unreal resources ensures that plugin doesn't do any work before the game starts.
2019-06-15 13:37:11 +01:00
Sebastian
c144658f37 Refactored ImGui widget and removed dependency on ImGui internal cursor data:
- Added SImGuiLayout to resets layout and house SImGuiWidget.
- Module manager creates SImGuiLayout instead of SImGuiWidget (eventually it should be replaced with a higher level object, like AHUD).
- Reworked ImGui canvas dragging and scaling and moved to SImGuiCanvasControl.
- Removed dependency on ImGui internal cursor data. New presentation is cleaner and doesn't use cursor data.
- Rendering code could be simplified after layout reset provided by SImGuiLayout.
- SImGuiWidget still handles input, rendering of ImGui draw data and activation of SImGuiCanvasControl.
- All widgets are in own subfolder.
2019-03-13 20:40:13 +00:00
Sebastian
09572a8ef9 Refactorization of ImGui settings:
- Divided ImGui settings into UImGuiSettings persistent object and FImGuiModuleSettings proxy that provides interface for other classes and handles delayed loading of UImGuiSettings.
- Removed from FImGuiModuleProperties and FImGuiModuleCommands direct dependencies on UImGuiSettings.
- Simplified FImGuiModuleProperties making it more robust when moving data after hot-reloading.
- Inverted binding logic by injecting FImGuiModuleProperties and FImGuiModuleCommands into FImGuiModuleSettings and letting it take care of synchronization. Dependencies are setup by module manager.
- Added to module manager FImGuiModuleSettings and interface to access it.
- Cleaned interface of FImGuiInputHandlerFactory and removed direct dependency on settings.
2018-12-08 21:03:18 +00:00
Sebastian
c662869820 Fixed duplicated registrations of ImGui Demo that were introduced in recent changes. 2018-11-27 20:56:02 +00:00
Sebastian
209a594616 Replaced module properties singleton with instance created as part of module manager:
- Removed ImGui Module Properties singleton interface and released construction constraints.
- Added ImGui Module Properties to ImGui Module Manager.
- Moved ImGui Demo to ImGui Module Manager.
- ImGui Demo and ImGui Module Commands keep reference to ImGui Module Manager that gives them access to properties.
2018-11-25 20:36:55 +00:00
Sebastian
dd06fcbbdf Added support for registering in module user textures to them in ImGui:
- Added ImGuiTextureHandle that is implicitly convertible to ImTextureID and can be used directly with ImGui interface.
- Added to ImGui Module interface allowing to register, update and release textures or find handles to existing resources.
- Refactored Texture Manager and added functions allowing create, update or release resources for user textures.
- Loosened resource verification policy in Texture Manager to work smoothly with external requests and to handle gracefully situations when invalid texture id is passed to ImGui.
- Introduced ‘error texture’ that is used for invalid resources.
2018-08-15 22:20:46 +01:00
Sebastian
d9220ad536 Fixed bad deallocation in Texture Manager and interface to create textures from raw data:
- Fixed rather embarrassing overlook in deallocation of data array passed from to CreateTexture from other function.
- Changed CreateTexture to use cleanup function passed with data (optional and only needed if data need to be released). Keeping data allocation and deallocation code together should make bugs like this easier to spot and avoid. Additionally this allows for more generic usage.
2018-08-14 20:28:25 +01:00
Sebastian
f57a73b91b Improved plugin to initialize correctly even when started during earlier loading phases:
- Split tick and textures initializations.
- Supporting deferred tick initialization, if Slate application is not ready during module startup.
- Textures are lazy-loaded before the first use.
- ImGui Context Manager initializes font atlas to make sure that ImGui resources are always initialized.
2018-05-24 21:55:25 +01:00
Sebastian
413b4f407a Upgraded to ImGui 1.61:
- Upgraded ImGui framework to 1.61 WIP, which adds a few improvements to context management.
- Removed from plugin implementation all the references to default ImGui context.
- Removed from ImGui Context Proxy destructor code switching to default ImGui context (there is no default context and decision is left for a higher level manager when to switch and to what context).
- Added own font atlas that is shared by all contexts and used explicitly to create Slate resources.
- Removed from ImGui Context Proxy workaround that was previously needed for copying cursor data to dynamically created contexts.
- Removed explicit saving of context settings before its destruction as this is now handled in ImGui::DestroyContext().
- Reimplemented ImGuiImplementation::GetCursorData() to use new interface.
2018-05-09 20:22:48 +01:00
Sebastian
fa32fd95e3 Added to ImGui Widget a canvas map mode that allows to drag and change scale of the ImGui canvas.
Map mode allows to reach areas of the canvas that otherwise would be inaccessible (for instance modal windows positioned in the centre of the canvas) and to modify which part should be visible by default.
2018-04-21 22:43:15 +01:00
Sebastian
2e994ac124 Fixed a few errors and warnings on PS4 and XBox platforms. 2018-02-02 23:14:17 +00:00
Sebastian
1a6aa98f51 Added support for session reloading and updated contexts and widgets management:
- Added to ImGui Context Proxy a name that is mapped to ini file set in ImGui context.
- ImGui Context Manager generates unique context names from world type and context index.
- Refactored ImGui Context Manager to have a cleaner separation between editor and non-editor bits.
- Fixed context update rules in ImGui Context Manager.
- Changed widgets management in ImGui Module Manager to allow automatic garbage collection after viewports are closed and manual removal when module is shutting down.
- ImGui Widgets are in full control of communication with context proxies.
- Added basic world context utilities.
- Refactored world context index utilities and replaced ambiguous 'default context index' with 'editor' and 'game' ones.
2017-09-27 21:16:54 +01:00
Sebastian
c47d911f22 Fixed issues with passing input focus between viewport and ImGui Widget. 2017-09-10 21:05:37 +01:00
Sebastian
77bb73dbce Added Multi-PIE support:
- Added ImGui Context Manager to create and manage ImGui Context Proxies.
- Changed ImGui Context Proxy to dynamically create context and allow pairing with input state.
- Changed ImGui Module Manager to create one widget per context.
- Changed ImGui Widget to work in different input modes.
- Changed ImGui Input State to allow partial reset (only mouse or keyboard).
2017-08-28 20:29:07 +01:00
Sebastian
393460f330 Added input support:
- Added ImGui Input State to collect and store input updates.
- Changed Slate ImGui Widget to handle Slate input events and store them in input state.
- Changed ImGui Context Proxy to copy input state to its context.
2017-04-22 16:38:04 +01:00
Sebastian
35f2d342a0 Added support for ImGui context update and rendering:
- Added ImGui Module Manager that that implements module logic and manages other module resources.
- Added Texture Manager to manage texture resources and maps them to index that can be passed to ImGui context.
- Added Context Proxy that represents and manages a single ImGui context.
- Added Slate ImGui Widget to render ImGui output.
2017-03-26 21:32:57 +01:00