PreviewRendererLoadState.h 947 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <PreviewRenderer/PreviewRendererState.h>
  10. namespace AtomToolsFramework
  11. {
  12. //! PreviewRendererLoadState pauses further rendering until all assets used for rendering a thumbnail have been loaded
  13. class PreviewRendererLoadState final : public PreviewRendererState
  14. {
  15. public:
  16. PreviewRendererLoadState(PreviewRenderer* renderer);
  17. ~PreviewRendererLoadState();
  18. void Update() override;
  19. private:
  20. AZStd::chrono::steady_clock::time_point m_startTime = AZStd::chrono::steady_clock::now();
  21. AZStd::chrono::steady_clock::time_point m_abortTime = AZStd::chrono::steady_clock::now() + AZStd::chrono::milliseconds(5000);
  22. };
  23. } // namespace AtomToolsFramework