1d4c483e73
- Remove some references to gEnv->pRenderer/GetIEditor()->GetRenderer() that is now always null. - Restore the debug console to existence. - Stop building the following in preparation for their removal: Code/CryEngine/Cry3DEngine/* Code/CryEngine/RenderDll/* Code/Tools/CryFXC/* Code/Tools/HLSLCrossCompiler/* Code/Tools/HLSLCrossCompilerMETAL/* Code/Tools/RC/* Code/Tools/ShaderCacheGen/* Tools/CrySCompileServer/*
65 lines
2.6 KiB
C++
65 lines
2.6 KiB
C++
/*
|
|
* All or portions of this file Copyright(c) Amazon.com, Inc.or its affiliates or
|
|
* its licensors.
|
|
*
|
|
* For complete copyright and license terms please see the LICENSE at the root of this
|
|
* distribution(the "License").All use of this software is governed by the License,
|
|
* or, if provided, by the license below or the license accompanying this file.Do not
|
|
* remove or modify any license notices.This file is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AzCore/Component/Component.h>
|
|
#include <AzCore/Component/TickBus.h>
|
|
#include <OtherActiveImGuiBus.h>
|
|
#include <DebugConsole.h>
|
|
|
|
#include <Atom/RPI.Public/ViewportContextBus.h>
|
|
|
|
namespace AZ
|
|
{
|
|
namespace LYIntegration
|
|
{
|
|
class ImGuiFeatureProcessor;
|
|
|
|
//! When Atom is enabled, ImGuiManager from LY's ImGui gem will hand over drawing of ImGui via @OtherActiveImGuiRequestBus to this system component.
|
|
//! Note: The LY ImGui gem only supports a single ImGui context, so Atom must have a single ImGui pass marked as the default.
|
|
class ImguiAtomSystemComponent final
|
|
: public AZ::Component
|
|
, public ImGui::OtherActiveImGuiRequestBus::Handler
|
|
// The Imgui Gem's ImGuiManager can handle this directly when engine is fully switched to Atom Renderer
|
|
, public AZ::RPI::ViewportContextNotificationBus::Handler
|
|
{
|
|
public:
|
|
AZ_COMPONENT(ImguiAtomSystemComponent, "{D423E075-D971-435A-A9C1-57C3B0623A9B}");
|
|
|
|
static void Reflect(AZ::ReflectContext* context);
|
|
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
|
|
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
|
|
static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatbile);
|
|
|
|
~ImguiAtomSystemComponent() override = default;
|
|
|
|
// AZ::Component
|
|
void Activate() override;
|
|
void Deactivate() override;
|
|
|
|
private:
|
|
void InitializeViewportSizeIfNeeded();
|
|
|
|
// OtherActiveImGuiRequestBus overrides ...
|
|
void RenderImGuiBuffers(const ImDrawData& drawData) override;
|
|
|
|
// ViewportContextNotificationBus overrides...
|
|
void OnRenderTick() override;
|
|
void OnViewportSizeChanged(AzFramework::WindowSize size) override;
|
|
|
|
DebugConsole m_debugConsole;
|
|
bool m_initialized = false;
|
|
};
|
|
} // namespace LYIntegration
|
|
} // namespace AZ
|