UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IStereoLayers Class Referenceabstract

#include <IStereoLayers.h>

Classes

struct  FLayerDesc
 

Public Types

enum  ELayerType { WorldLocked , TrackerLocked , FaceLocked }
 
enum  ELayerFlags {
  LAYER_FLAG_TEX_CONTINUOUS_UPDATE = 0x00000001 , LAYER_FLAG_TEX_NO_ALPHA_CHANNEL = 0x00000002 , LAYER_FLAG_QUAD_PRESERVE_TEX_RATIO = 0x00000004 , LAYER_FLAG_SUPPORT_DEPTH = 0x00000008 ,
  LAYER_FLAG_TEX_EXTERNAL = 0x00000010 , LAYER_FLAG_HIDDEN = 0x00000020 , LAYER_FLAG_DEBUG = 0x00000040 , LAYER_FLAG_MAX_VALUE = LAYER_FLAG_DEBUG << 1
}
 

Public Member Functions

virtual PRAGMA_DISABLE_DEPRECATION_WARNINGS ~IStereoLayers ()
 
virtual PRAGMA_ENABLE_DEPRECATION_WARNINGS uint32 CreateLayer (const FLayerDesc &InLayerDesc)=0
 
virtual void DestroyLayer (uint32 LayerId)=0
 
virtual void PushLayerState (bool bPreserve=false)
 
virtual void PopLayerState ()
 
virtual bool SupportsLayerState ()
 
virtual void HideBackgroundLayer ()
 
virtual void ShowBackgroundLayer ()
 
virtual bool IsBackgroundLayerVisible () const
 
virtual void SetLayerDesc (uint32 LayerId, const FLayerDesc &InLayerDesc)=0
 
virtual bool GetLayerDesc (uint32 LayerId, FLayerDesc &OutLayerDesc)=0
 
virtual const FLayerDescFindLayerDesc (uint32 LayerId) const
 
virtual void MarkTextureForUpdate (uint32 LayerId)=0
 
virtual void UpdateSplashScreen () final
 
virtual bool ShouldCopyDebugLayersToSpectatorScreen () const final
 
virtual TArray< FTextureRHIRef, TInlineAllocator< 2 > > GetDebugLayerTextures_RenderThread ()
 
virtual FLayerDesc GetDebugCanvasLayerDesc (FTextureRHIRef Texture) final
 
virtual ENGINE_API FLayerDesc GetDebugCanvasLayerDesc (class UTextureRenderTarget2D *Texture)
 
virtual void GetAllocatedTexture (uint32 LayerId, FTextureRHIRef &Texture, FTextureRHIRef &LeftTexture)
 

Protected Attributes

PRAGMA_DISABLE_DEPRECATION_WARNINGS bool bSplashIsShown = false
 
bool bSplashShowMovie = false
 
FTextureRHIRef SplashTexture
 
FTextureRHIRef SplashMovie
 
FVector SplashOffset = FVector::ZeroVector
 
FVector2D SplashScale = FVector2D(1.0f, 1.0f)
 
uint32 SplashLayerHandle = 0
 

Member Enumeration Documentation

◆ ELayerFlags

Enumerator
LAYER_FLAG_TEX_CONTINUOUS_UPDATE 
LAYER_FLAG_TEX_NO_ALPHA_CHANNEL 
LAYER_FLAG_QUAD_PRESERVE_TEX_RATIO 
LAYER_FLAG_SUPPORT_DEPTH 
LAYER_FLAG_TEX_EXTERNAL 
LAYER_FLAG_HIDDEN 
LAYER_FLAG_DEBUG 
LAYER_FLAG_MAX_VALUE 

◆ ELayerType

Enumerator
WorldLocked 
TrackerLocked 
FaceLocked 

Constructor & Destructor Documentation

◆ ~IStereoLayers()

virtual PRAGMA_DISABLE_DEPRECATION_WARNINGS IStereoLayers::~IStereoLayers ( )
inlinevirtual

Member Function Documentation

◆ CreateLayer()

virtual PRAGMA_ENABLE_DEPRECATION_WARNINGS uint32 IStereoLayers::CreateLayer ( const FLayerDesc InLayerDesc)
pure virtual

Creates a new layer from a given texture resource, which is projected on top of the world as a quad.

Parameters
InLayerDescA reference to the texture resource to be used on the quad
Returns
A unique identifier for the layer created

◆ DestroyLayer()

virtual void IStereoLayers::DestroyLayer ( uint32  LayerId)
pure virtual

Destroys the specified layer, stopping it from rendering over the world.

Parameters
LayerIdThe ID of layer to be destroyed

◆ FindLayerDesc()

virtual const FLayerDesc * IStereoLayers::FindLayerDesc ( uint32  LayerId) const
inlinevirtual

Get a reference to the internal FLayerDesc structure for a given layer ID Only finds layers from the top of the Push/PopLayerState stack

  • Deprecated 5.6 Behavior: Implementations may choose not to implement this.
  • Callers supporting pre-5.6 plugins should fallback to GetLayerDesc if this returns nullptr.
    Parameters
    LayerIdThe ID of the layer to find
    Returns
    Pointer to the layer desc, or null if no layer was found

◆ GetAllocatedTexture()

virtual void IStereoLayers::GetAllocatedTexture ( uint32  LayerId,
FTextureRHIRef Texture,
FTextureRHIRef LeftTexture 
)
inlinevirtual

Get texture reference to HMD swapchain to avoid the copy path, useful for continuous update layers

◆ GetDebugCanvasLayerDesc() [1/2]

IStereoLayers::FLayerDesc IStereoLayers::GetDebugCanvasLayerDesc ( class UTextureRenderTarget2D Texture)
virtual

◆ GetDebugCanvasLayerDesc() [2/2]

virtual FLayerDesc IStereoLayers::GetDebugCanvasLayerDesc ( FTextureRHIRef  Texture)
inlinefinalvirtual

◆ GetDebugLayerTextures_RenderThread()

virtual TArray< FTextureRHIRef, TInlineAllocator< 2 > > IStereoLayers::GetDebugLayerTextures_RenderThread ( )
inlinevirtual

Returns a list of debug textures to be rendered onto the default spectator screen. This is intended to be the textures for layers which have LAYER_FLAG_DEBUG set. All textures in this array should be nonnull and 2D in dimension.

◆ GetLayerDesc()

virtual bool IStereoLayers::GetLayerDesc ( uint32  LayerId,
FLayerDesc OutLayerDesc 
)
pure virtual

Get the currently set layer description

Parameters
LayerIdThe ID of layer to be set the description
OutLayerDescThe returned layer description
Returns
Whether the returned layer description is valid

◆ HideBackgroundLayer()

virtual void IStereoLayers::HideBackgroundLayer ( )
inlinevirtual

Optional method to hide the 3D scene and only render the stereo overlays. No-op if not supported by the platform.

If pushing and popping layer state is supported, the visibility of the background layer should be part of the saved state.

◆ IsBackgroundLayerVisible()

virtual bool IStereoLayers::IsBackgroundLayerVisible ( ) const
inlinevirtual

Tell if the background layer is visible. Platforms that do not implement Hide/ShowBackgroundLayer() always return true.

◆ MarkTextureForUpdate()

virtual void IStereoLayers::MarkTextureForUpdate ( uint32  LayerId)
pure virtual

Marks this layers texture for update

Parameters
LayerIdThe ID of layer to be set the description

◆ PopLayerState()

virtual void IStereoLayers::PopLayerState ( )
inlinevirtual

Restores the stereo layer state from the last save state.

Currently active layers will be destroyed and replaced with the previous state.

◆ PushLayerState()

virtual void IStereoLayers::PushLayerState ( bool  bPreserve = false)
inlinevirtual

Saves the current stereo layer state on a stack to later restore them.

Useful for creating temporary overlays that should be torn down later.

When bPreserve is false, existing layers will be temporarily disabled and restored again when calling PopLayerState() The disabled layer's properties are still accessible by calling Get and SetLayerDesc, but nothing will change until after the state has been restored. Calling DestroyLayer on an inactive layer, will prevent it from being restored when PopLayerState() is called.

When bPreserve is true, existing layers will remain active, but when calling PopLayerState(), any changed properties will be restored back to their previous values. Calling DestroyLayer on an active layer id will make the layer inactive. The layer will be reactivated when the state is restored. (You can call DestroyLayer multiple times on the same layer id to remove successively older versions of a layer.)

In either case, layers created after PushLayerState() will be destroyed upon calling PopLayerState().

Parameters
bPreserveWhether the existing layers should be preserved after saving the state. If false all existing layers will be disabled.

◆ SetLayerDesc()

virtual void IStereoLayers::SetLayerDesc ( uint32  LayerId,
const FLayerDesc InLayerDesc 
)
pure virtual

Set the a new layer description

Parameters
LayerIdThe ID of layer to be set the description
InLayerDescThe new description to be set

◆ ShouldCopyDebugLayersToSpectatorScreen()

virtual bool IStereoLayers::ShouldCopyDebugLayersToSpectatorScreen ( ) const
inlinefinalvirtual

If true the debug layers are copied to the spectator screen, because they do not naturally end up on the spectator screen as part of the 3d view.

◆ ShowBackgroundLayer()

virtual void IStereoLayers::ShowBackgroundLayer ( )
inlinevirtual

Optional method to undo the effect of hiding the 3D scene. No-op if not supported by the platform.

◆ SupportsLayerState()

virtual bool IStereoLayers::SupportsLayerState ( )
inlinevirtual

Returns true if the StereoLayers implementation supports saving and restoring state using Push/PopLayerState()

◆ UpdateSplashScreen()

virtual void IStereoLayers::UpdateSplashScreen ( )
inlinefinalvirtual

Update splash screens from current state

Member Data Documentation

◆ bSplashIsShown

PRAGMA_DISABLE_DEPRECATION_WARNINGS bool IStereoLayers::bSplashIsShown = false
protected

◆ bSplashShowMovie

bool IStereoLayers::bSplashShowMovie = false
protected

◆ SplashLayerHandle

uint32 IStereoLayers::SplashLayerHandle = 0
protected

◆ SplashMovie

FTextureRHIRef IStereoLayers::SplashMovie
protected

◆ SplashOffset

FVector IStereoLayers::SplashOffset = FVector::ZeroVector
protected

◆ SplashScale

FVector2D IStereoLayers::SplashScale = FVector2D(1.0f, 1.0f)
protected

◆ SplashTexture

FTextureRHIRef IStereoLayers::SplashTexture
protected

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