XRDevice.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #include <XR/XRDevice.h>
  9. #include <XR/XRSwapChain.h>
  10. namespace XR
  11. {
  12. AZ::RHI::ResultCode Device::Init(Descriptor descriptor)
  13. {
  14. m_descriptor = descriptor;
  15. return AZ::RHI::ResultCode::Success;
  16. }
  17. const Device::Descriptor& Device::GetDescriptor() const
  18. {
  19. return m_descriptor;
  20. }
  21. Ptr<Session> Device::GetSession() const
  22. {
  23. return m_session;
  24. }
  25. bool Device::BeginFrame()
  26. {
  27. return BeginFrameInternal();
  28. }
  29. void Device::EndFrame(Ptr<SwapChain> swapChain)
  30. {
  31. EndFrameInternal(swapChain);
  32. }
  33. bool Device::AcquireSwapChainImage(AZ::u32 viewIndex, XR::SwapChain* baseSwapChain)
  34. {
  35. return AcquireSwapChainImageInternal(viewIndex, baseSwapChain);
  36. }
  37. void Device::RegisterSession(Ptr<Session> session)
  38. {
  39. m_session = session;
  40. }
  41. void Device::UnRegisterSession()
  42. {
  43. m_session = nullptr;
  44. }
  45. void Device::Shutdown()
  46. {
  47. ShutdownInternal();
  48. }
  49. } // namespace XR