Navigation
API > API/Plugins > API/Plugins/TextureShare
TextureShare context Is an abstract container that should be used by the user to handle callback logic.
Multithreading: The implementation of TS on the UE side is multithreaded.
Every frame in the game thread we have to create a new context and populate it with new data. Then set it using the ITextureShareObject::SetTextureShareContext() function.
This context is passed from the game thread to the rendering thread. (from the ITextureShareObject to the ITextureShareObjectProxy) With this approach, we get unique context data for both threads.
Callbacks: Global TS callbacks are implemented in ITextureShareCallbacks. All of them can be used by different implementations at the same time. Therefore, we must separate the logic of these callbacks from each other. This can easily be done by implementing them in unique classes that are children of ITextureShareContext. For example, by checking the context of a TS object using one of these two functions: if(ITextureShareObject::GetTextureShareContext() == this) ... if(ITextureShareObjectProxy::GetTextureShareContext_RenderThread() == this) ...
Custom implementation: Each custom implementation can create and use a new context class based on the ITextureShareContext class. It may also contain additional custom data for callbacks logic.
| Name | ITextureShareContext |
| Type | class |
| Header File | /Engine/Plugins/VirtualProduction/TextureShare/Source/TextureShare/Public/ITextureShareContext.h |
| Include Path | #include "ITextureShareContext.h" |
Syntax
class ITextureShareContext : public TSharedFromThis< ITextureShareContext, ESPMode::ThreadSafe >
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → ITextureShareContext
Derived Classes
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~ITextureShareContext() |
ITextureShareContext.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FName GetRTTI() |
A quick and dirty way to determine which TS data (sub)class this is. | ITextureShareContext.h | |
bool IsA
(
const ITextureShareContext&& Other |
Returns true if the given object is of the same type. | ITextureShareContext.h | |
virtual void RegisterTextureShareContextCallbacks() |
Register callbacks for the game thread. | ITextureShareContext.h | |
virtual void RegisterTextureShareContextCallbacks_RenderThread() |
Register callbacks for the rendering thread. | ITextureShareContext.h | |
virtual void UnregisterTextureShareContextCallbacks() |
Unregister callbacks for the game thread. | ITextureShareContext.h | |
virtual void UnregisterTextureShareContextCallbacks_RenderThread() |
Unregister callbacks for the rendering thread. | ITextureShareContext.h |