Navigation
API > API/Plugins > API/Plugins/XRBase
Inheritance Hierarchy
- IStereoLayers
- TStereoLayerManager
- FSimpleLayerManager
- FDefaultStereoLayers
References
Module | XRBase |
Header | /Engine/Plugins/Runtime/XRBase/Source/XRBase/Public/StereoLayerManager.h |
Include | #include "StereoLayerManager.h" |
Syntax
template<typename LayerType>
class TStereoLayerManager : public IStereoLayers
Remarks
Partial implementation of the Layer management code for the IStereoLayers interface. Implements adding, deleting and updating layers regardless of how they are rendered.
A class that wishes to implement the IStereoLayer interface can extend this class instead. The template argument should be a type for storing layer data. It should have a constructor matching the following: LayerType(const FLayerDesc& InLayerDesc); ... and implement the following function overloads: void SetLayerId(uint32 InId), uint32 GetLayerId() const, bool GetLayerDescMember(LayerType& Layer, FLayerDesc& OutLayerDesc), void SetLayerDescMember(LayerType& Layer, const FLayerDesc& Desc), and void MarkLayerTextureForUpdate(LayerType& Layer)
To perform additional bookkeeping each time individual layers are changed, you can override the following protected method: UpdateLayer(LayerType& Layer, uint32 LayerId, bool bIsValid) It is called whenever CreateLayer, DestroyLayer, SetLayerDesc and MarkTextureForUpdate are called.
Simple implementations that do not to track additional data per layer may use FLayerDesc directly. The FSimpleLayerManager subclass can be used in that case and it implements all the required glue functions listed above.
To access the layer data from your subclass, you have the following protected interface: bool GetStereoLayersDirty() Returns true if layer data have changed since the status was last cleared ForEachLayer(...) pass in a lambda to iterate through each existing layer. CopyLayers(TArray
Thread safety: Updates and the two protected access methods use a critical section to ensure atomic access to the layer structures. Therefore, it is probably better to copy layers before performing time consuming operations using CopyLayers and reserve ForEachLayer for simple processing or operations where you need to know the user-facing layer id. The WithLayer method is useful if you already know the id of a layer you need to access in a thread safe manner.
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | CopyLayers
(
TArray< LayerType >& OutArray, |
|
![]() |
void | CopySortedLayers
(
TArray< LayerType >& OutArray, |
|
![]() ![]() |
uint32 | CreateLayer
(
const FLayerDesc& InLayerDesc |
|
![]() ![]() |
void | DestroyLayer
(
uint32 LayerId |
|
![]() |
void | ForEachLayer
(
TFunction< void(uint32, LayerType&)> Func, |
|
![]() ![]() |
void | GetAllocatedTexture
(
uint32 LayerId, |
|
![]() ![]() |
bool | GetLayerDesc
(
uint32 LayerId, |
|
![]() |
bool | ||
![]() ![]() |
void | ||
![]() ![]() ![]() |
bool | ||
![]() ![]() |
void | MarkTextureForUpdate
(
uint32 LayerId |
|
![]() ![]() |
void | ||
![]() ![]() |
void | PushLayerState
(
bool bPreserve |
|
![]() ![]() |
void | SetLayerDesc
(
uint32 LayerId, |
|
![]() ![]() |
void | ||
![]() ![]() |
bool | ||
![]() ![]() |
void | UpdateLayer
(
LayerType& Layer, |
|
![]() ![]() |
void | ||
![]() |
void |