UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ComponentRecreateRenderStateContext.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
9#include "SceneInterface.h"
10
13{
14private:
16 UActorComponent* Component = nullptr;
17 IPrimitiveComponent* ComponentInterface = nullptr;
18
19 TSet<FSceneInterface*>* ScenesToUpdateAllPrimitiveSceneInfos = nullptr;
20
21public:
23 : ScenesToUpdateAllPrimitiveSceneInfos(InScenesToUpdateAllPrimitiveSceneInfos)
24 {
26 checkf(!InComponentInterface->IsUnreachable(), TEXT("%s"), *InComponentInterface->GetFullName());
27
28 if (InComponentInterface->IsRegistered() && InComponentInterface->IsRenderStateCreated())
29 {
30 InComponentInterface->DestroyRenderState();
31 ComponentInterface = InComponentInterface;
32
34 }
35 }
36
38 : ScenesToUpdateAllPrimitiveSceneInfos(InScenesToUpdateAllPrimitiveSceneInfos)
39 {
41 checkf(!InComponent->IsUnreachable(), TEXT("%s"), *InComponent->GetFullName());
42
43 if (InComponent->IsRegistered() && InComponent->IsRenderStateCreated())
44 {
45 InComponent->DestroyRenderState_Concurrent();
47
48 UpdateAllPrimitiveSceneInfosForSingleComponent(InComponent, ScenesToUpdateAllPrimitiveSceneInfos);
49 }
50 }
51
54
57 , ComponentInterface(Other.ComponentInterface)
58 , ScenesToUpdateAllPrimitiveSceneInfos(Other.ScenesToUpdateAllPrimitiveSceneInfos)
59 {
60 Other.Component = nullptr;
61 Other.ComponentInterface = nullptr;
62 Other.ScenesToUpdateAllPrimitiveSceneInfos = nullptr;
63 }
64
66 {
67 Component = Other.Component;
68 ComponentInterface = Other.ComponentInterface ;
69 ScenesToUpdateAllPrimitiveSceneInfos = Other.ScenesToUpdateAllPrimitiveSceneInfos;
70 Other.Component = nullptr;
71 Other.ComponentInterface = nullptr;
72 Other.ScenesToUpdateAllPrimitiveSceneInfos = nullptr;
73 return *this;
74 }
75
77};
78
ENGINE_API void UpdateAllPrimitiveSceneInfosForSingleComponent(UActorComponent *InComponent, TSet< FSceneInterface * > *InScenesToUpdateAllPrimitiveSceneInfosForBatching=nullptr)
Definition ActorComponent.cpp:295
ENGINE_API void UpdateAllPrimitiveSceneInfosForSingleComponentInterface(IPrimitiveComponent *InComponent, TSet< FSceneInterface * > *InScenesToUpdateAllPrimitiveSceneInfosForBatching=nullptr)
Definition ActorComponent.cpp:316
#define check(expr)
Definition AssertionMacros.h:314
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition ComponentRecreateRenderStateContext.h:13
ENGINE_API ~FComponentRecreateRenderStateContext()
Definition ActorComponent.cpp:423
FComponentRecreateRenderStateContext(FComponentRecreateRenderStateContext &&Other)
Definition ComponentRecreateRenderStateContext.h:55
FComponentRecreateRenderStateContext & operator=(FComponentRecreateRenderStateContext &&Other)
Definition ComponentRecreateRenderStateContext.h:65
FComponentRecreateRenderStateContext(IPrimitiveComponent *InComponentInterface, TSet< FSceneInterface * > *InScenesToUpdateAllPrimitiveSceneInfos=nullptr)
Definition ComponentRecreateRenderStateContext.h:22
FComponentRecreateRenderStateContext & operator=(const FComponentRecreateRenderStateContext &)=delete
FComponentRecreateRenderStateContext(UActorComponent *InComponent, TSet< FSceneInterface * > *InScenesToUpdateAllPrimitiveSceneInfos=nullptr)
Definition ComponentRecreateRenderStateContext.h:37
FComponentRecreateRenderStateContext(const FComponentRecreateRenderStateContext &)=delete
Definition ComponentRecreateRenderStateContext.h:81
ENGINE_API ~FGlobalComponentRecreateRenderStateContext()
Definition ActorComponent.cpp:507
static int32 ActiveGlobalRecreateRenderStateContextCount
Definition ComponentRecreateRenderStateContext.h:98
ENGINE_API FGlobalComponentRecreateRenderStateContext()
Definition ActorComponent.cpp:448
Definition ComponentInterfaces.h:59
Definition Array.h:670
Definition ActorComponent.h:152