feat: add ResizeBuffers event to UiBuilder

This commit is contained in:
goat 2021-09-02 13:41:09 +02:00
parent 8820f84d2b
commit 395328eb17
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 22 additions and 3 deletions

View file

@ -133,10 +133,15 @@ namespace Dalamud.Interface.Internal
private delegate void InstallRTSSHook();
/// <summary>
/// This event gets called by a plugin UiBuilder when read
/// This event gets called each frame to facilitate ImGui drawing.
/// </summary>
public event RawDX11Scene.BuildUIDelegate Draw;
/// <summary>
/// This event gets called when ResizeBuffers is called.
/// </summary>
public event Action ResizeBuffers;
/// <summary>
/// Gets or sets an action that is executed when fonts are rebuilt.
/// </summary>
@ -545,6 +550,8 @@ namespace Dalamud.Interface.Internal
Log.Verbose($"Calling resizebuffers swap@{swapChain.ToInt64():X}{bufferCount} {width} {height} {newFormat} {swapChainFlags}");
#endif
this.ResizeBuffers?.Invoke();
// We have to ensure we're working with the main swapchain,
// as viewports might be resizing as well
if (this.scene == null || swapChain != this.scene.SwapChain.NativePointer)