Plasma Engine  2.0
Loading...
Searching...
No Matches
plXRInterface Class Referenceabstract

XR singleton interface. Needs to be initialized to be used for VR or AR purposes. More...

#include <XRInterface.h>

Inheritance diagram for plXRInterface:

Public Member Functions

virtual bool IsHmdPresent () const =0
 Returns whether an HMD is available. Can be used to decide whether it makes sense to call Initialize at all.
 
Setup
virtual plResult Initialize ()=0
 Initializes the XR system. This can be quite time consuming as it will generally start supporting applications needed to run and start up the HMD if it went to sleep.
 
virtual void Deinitialize ()=0
 Shuts down the XR system again.
 
virtual bool IsInitialized () const =0
 Returns whether the XR system is initialized.
 
Devices
virtual const plHMDInfoGetHmdInfo () const =0
 Returns general HMD information.
 
virtual plXRInputDeviceGetXRInput () const =0
 Returns the XR input device.
 
View
virtual bool SupportsCompanionView ()=0
 Returns true if a companion window can be passed into CreateActor.
 
virtual plUniquePtr< plActorCreateActor (plView *pView, plGALMSAASampleCount::Enum msaaCount=plGALMSAASampleCount::None, plUniquePtr< plWindowBase > pCompanionWindow=nullptr, plUniquePtr< plWindowOutputTargetGAL > pCompanionWindowOutput=nullptr)=0
 Creates a XR actor by trying to startup an XR session.
 
Internal
virtual plGALTextureHandle GetCurrentTexture ()=0
 Called by plWindowOutputTargetXR::RenderCompanionView Returns the color texture to be used by the companion view if enabled, otherwise an invalid handle.
 
virtual void OnActorDestroyed ()=0
 Called when the actor created by 'CreateActor' is destroyed.
 

Detailed Description

XR singleton interface. Needs to be initialized to be used for VR or AR purposes.

To be used in a project the project needs to have an enabled plXRConfig with a set render pipeline in the platform profile. To then use the interface, Initialize must be called first and on success CreateActor. Everything else is optional. Aquire interface via plSingletonRegistry::GetSingletonInstance<plXRInterface>().

Member Function Documentation

◆ CreateActor()

virtual plUniquePtr< plActor > plXRInterface::CreateActor ( plView * pView,
plGALMSAASampleCount::Enum msaaCount = plGALMSAASampleCount::None,
plUniquePtr< plWindowBase > pCompanionWindow = nullptr,
plUniquePtr< plWindowOutputTargetGAL > pCompanionWindowOutput = nullptr )
pure virtual

Creates a XR actor by trying to startup an XR session.

If SupportsCompanionView is true (VR only), a normal window and window output can be passed in. The window will be used to blit the VR output into the window.

Implemented in plDummyXR, and plOpenXR.

◆ Deinitialize()

virtual void plXRInterface::Deinitialize ( )
pure virtual

Shuts down the XR system again.

Implemented in plDummyXR, and plOpenXR.

◆ GetCurrentTexture()

virtual plGALTextureHandle plXRInterface::GetCurrentTexture ( )
pure virtual

Called by plWindowOutputTargetXR::RenderCompanionView Returns the color texture to be used by the companion view if enabled, otherwise an invalid handle.

Implemented in plDummyXR, and plOpenXR.

◆ GetHmdInfo()

virtual const plHMDInfo & plXRInterface::GetHmdInfo ( ) const
pure virtual

Returns general HMD information.

Implemented in plDummyXR, and plOpenXR.

◆ GetXRInput()

virtual plXRInputDevice & plXRInterface::GetXRInput ( ) const
pure virtual

Returns the XR input device.

Implemented in plDummyXR, and plOpenXR.

◆ Initialize()

virtual plResult plXRInterface::Initialize ( )
pure virtual

Initializes the XR system. This can be quite time consuming as it will generally start supporting applications needed to run and start up the HMD if it went to sleep.

Implemented in plDummyXR, and plOpenXR.

◆ IsHmdPresent()

virtual bool plXRInterface::IsHmdPresent ( ) const
pure virtual

Returns whether an HMD is available. Can be used to decide whether it makes sense to call Initialize at all.

Implemented in plDummyXR, and plOpenXR.

◆ IsInitialized()

virtual bool plXRInterface::IsInitialized ( ) const
pure virtual

Returns whether the XR system is initialized.

Implemented in plDummyXR, and plOpenXR.

◆ OnActorDestroyed()

virtual void plXRInterface::OnActorDestroyed ( )
pure virtual

Called when the actor created by 'CreateActor' is destroyed.

Implemented in plDummyXR, and plOpenXR.

◆ SupportsCompanionView()

virtual bool plXRInterface::SupportsCompanionView ( )
pure virtual

Returns true if a companion window can be passed into CreateActor.

Implemented in plDummyXR, and plOpenXR.


The documentation for this class was generated from the following file: