Navigation
API > API/Plugins > API/Plugins/XRBase
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, LayerType& OutLayerDesc), void SetLayerDescMember(LayerType& Layer, const LayerType& 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: All functions and state in this class should only be accessed from the game thread.
| Name | FSimpleLayerManager |
| Type | class |
| Header File | /Engine/Plugins/Runtime/XRBase/Source/XRBase/Public/StereoLayerManager.h |
| Include Path | #include "StereoLayerManager.h" |
Syntax
template<typename LayerType>
class FSimpleLayerManager :
public TStereoLayerManager< IStereoLayers::FLayerDesc >,
public FGCObject
Inheritance Hierarchy
- TStereoLayerManager< IStereoLayers::FLayerDesc > → FSimpleLayerManager
- FGCObject → FSimpleLayerManager
Derived Classes
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AddReferencedObjects
(
FReferenceCollector& Collector |
StereoLayerManager.h | ||
virtual uint32 CreateLayer
(
const FLayerDesc& InLayerDesc |
Shadowed to silence deprecation warnings. | StereoLayerManager.h | |
virtual void DestroyLayer
(
uint32 LayerId |
Shadowed to silence deprecation warnings. | StereoLayerManager.h | |
virtual const FLayerDesc * FindLayerDesc
(
uint32 LayerId |
StereoLayerManager.h | ||
void ForEachLayer
(
F&& Func, |
Shadowed to silence deprecation warnings. | StereoLayerManager.h | |
virtual FString GetReferencerName() |
StereoLayerManager.h | ||
bool GetStereoLayersDirty() |
Shadowed to silence deprecation warnings. | StereoLayerManager.h | |
bool IsBackgroundLayerVisible() |
Shadowed to silence deprecation warnings. | StereoLayerManager.h | |
virtual void SetLayerDesc
(
uint32 LayerId, |
Shadowed to silence deprecation warnings. | StereoLayerManager.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void MarkTextureForUpdate
(
uint32 LayerId |
StereoLayerManager.h |