MultiViewSingleSceneAuxGeomExampleComponent.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
  3. * its licensors.
  4. *
  5. * For complete copyright and license terms please see the LICENSE at the root of this
  6. * distribution (the "License"). All use of this software is governed by the License,
  7. * or, if provided, by the license below or the license accompanying this file. Do not
  8. * remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
  9. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. *
  11. */
  12. #pragma once
  13. #include <CommonSampleComponentBase.h>
  14. #include <Atom/RPI.Public/Base.h>
  15. #include <Atom/RPI.Public/WindowContext.h>
  16. #include <AzCore/Asset/AssetCommon.h>
  17. #include <AzCore/Component/TickBus.h>
  18. #include <AzFramework/Windowing/WindowBus.h>
  19. #include <AzFramework/Windowing/NativeWindow.h>
  20. struct ImGuiContext;
  21. namespace AtomSampleViewer
  22. {
  23. //! A sample component to demonstrate multiple scenes.
  24. class MultiViewSingleSceneAuxGeomExampleComponent final
  25. : public CommonSampleComponentBase
  26. , public AZ::TickBus::Handler
  27. {
  28. public:
  29. AZ_COMPONENT(MultiViewSingleSceneAuxGeomExampleComponent, "{B5B97744-407C-467B-AE21-23323454F988}", CommonSampleComponentBase);
  30. static void Reflect(AZ::ReflectContext* context);
  31. MultiViewSingleSceneAuxGeomExampleComponent();
  32. ~MultiViewSingleSceneAuxGeomExampleComponent() override = default;
  33. // AZ::Component
  34. void Activate() override;
  35. void Deactivate() override;
  36. void OnChildWindowClosed();
  37. private:
  38. // AZ::TickBus::Handler overrides ...
  39. void OnTick(float deltaTime, AZ::ScriptTimePoint timePoint) override;
  40. void OpenSecondSceneWindow();
  41. void DrawAuxGeom() const;
  42. AZ::Component* m_mainCameraControlComponent = nullptr;
  43. AZStd::unique_ptr<class WindowedView> m_windowedView;
  44. };
  45. } // namespace AtomSampleViewer