Plasma Engine  2.0
Loading...
Searching...
No Matches
RenderTargetActivatorComponent.h
1#pragma once
2
3#include <Core/World/World.h>
4#include <RendererCore/Components/RenderComponent.h>
5#include <RendererCore/Textures/Texture2DResource.h>
6
8
10
21class PL_RENDERERCORE_DLL plRenderTargetActivatorComponent : public plRenderComponent
22{
24
26 // plComponent
27public:
28 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
29 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
30
31
33 // plRenderComponent
34
35public:
36 virtual plResult GetLocalBounds(plBoundingBoxSphere& ref_bounds, bool& ref_bAlwaysVisible, plMsgUpdateLocalBounds& ref_msg) override;
37
38
40 // plRenderTargetActivatorComponent
41
42public:
45
47 void SetRenderTargetFile(const char* szFile); // [ property ]
48 const char* GetRenderTargetFile() const; // [ property ]
49
51 void SetRenderTarget(const plRenderToTexture2DResourceHandle& hResource);
52 plRenderToTexture2DResourceHandle GetRenderTarget() const { return m_hRenderTarget; }
53
54private:
55 void OnMsgExtractRenderData(plMsgExtractRenderData& msg) const;
56
58};
virtual void SerializeComponent(plWorldWriter &inout_stream) const
Override this to save the current state of the component to the given stream.
Definition Component.cpp:54
virtual void DeserializeComponent(plWorldReader &inout_stream)
Override this to load the current state of the component from the given stream.
Definition Component.cpp:58
Definition ComponentManager.h:88
Base class for objects that should be rendered.
Definition RenderComponent.h:9
virtual plResult GetLocalBounds(plBoundingBoxSphere &ref_bounds, bool &ref_bAlwaysVisible, plMsgUpdateLocalBounds &ref_msg)=0
Called by plRenderComponent::OnUpdateLocalBounds(). If PL_SUCCESS is returned, bounds and bAlwaysVisi...
Attach this component to an object that uses a render target for reading, to ensure that the render t...
Definition RenderTargetActivatorComponent.h:22
Reads a world description from a stream. Allows to instantiate that world multiple times in different...
Definition WorldReader.h:47
Stores an entire plWorld in a stream.
Definition WorldWriter.h:13
Definition RenderData.h:116
Definition UpdateLocalBoundsMessage.h:9
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54