Integrating github/staging through commit ab87ed9
This commit is contained in:
@@ -16,6 +16,11 @@
|
||||
#include <AzFramework/Windowing/WindowBus.h>
|
||||
#include <Atom/Feature/ImGui/ImGuiUtils.h>
|
||||
#include <Atom/Feature/ImGui/SystemBus.h>
|
||||
#include <Atom/RPI.Public/ViewportContext.h>
|
||||
|
||||
#if defined(IMGUI_ENABLED)
|
||||
#include <ImGuiBus.h>
|
||||
#endif
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -49,16 +54,28 @@ namespace AZ
|
||||
void ImguiAtomSystemComponent::Activate()
|
||||
{
|
||||
ImGui::OtherActiveImGuiRequestBus::Handler::BusConnect();
|
||||
|
||||
auto atomViewportRequests = AZ::Interface<AZ::RPI::ViewportContextRequestsInterface>::Get();
|
||||
const AZ::Name contextName = atomViewportRequests->GetDefaultViewportContextName();
|
||||
AZ::RPI::ViewportContextNotificationBus::Handler::BusConnect(contextName);
|
||||
}
|
||||
|
||||
void ImguiAtomSystemComponent::Deactivate()
|
||||
{
|
||||
ImGui::OtherActiveImGuiRequestBus::Handler::BusDisconnect();
|
||||
AZ::RPI::ViewportContextNotificationBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
void ImguiAtomSystemComponent::RenderImGuiBuffers(const ImDrawData& drawData)
|
||||
{
|
||||
Render::ImGuiSystemRequestBus::Broadcast(&Render::ImGuiSystemRequests::RenderImGuiBuffersToDefaultPass, drawData);
|
||||
Render::ImGuiSystemRequestBus::Broadcast(&Render::ImGuiSystemRequests::RenderImGuiBuffersToCurrentViewport, drawData);
|
||||
}
|
||||
|
||||
void ImguiAtomSystemComponent::OnRenderTick()
|
||||
{
|
||||
#if defined(IMGUI_ENABLED)
|
||||
ImGui::ImGuiManagerListenerBus::Broadcast(&ImGui::IImGuiManagerListener::Render);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user