Plasma Engine  2.0
Loading...
Searching...
No Matches
SwapChain.h
1
2#pragma once
3
4#include <RendererFoundation/RendererFoundationDLL.h>
5
6#include <Foundation/Math/Size.h>
7#include <RendererFoundation/Descriptors/Descriptors.h>
8#include <RendererFoundation/Resources/RenderTargetSetup.h>
9
10class PL_RENDERERFOUNDATION_DLL plGALSwapChain : public plGALObject<plGALSwapChainCreationDescription>
11{
12public:
13 const plGALRenderTargets& GetRenderTargets() const { return m_RenderTargets; }
14 plGALTextureHandle GetBackBufferTexture() const { return m_RenderTargets.m_hRTs[0]; }
15 plSizeU32 GetCurrentSize() const { return m_CurrentSize; }
16
17 virtual void AcquireNextRenderTarget(plGALDevice* pDevice) = 0;
18 virtual void PresentRenderTarget(plGALDevice* pDevice) = 0;
19 virtual plResult UpdateSwapChain(plGALDevice* pDevice, plEnum<plGALPresentMode> newPresentMode) = 0;
20
21 virtual ~plGALSwapChain();
22
23protected:
24 friend class plGALDevice;
25
26 plGALSwapChain(const plRTTI* pSwapChainType);
27
28 virtual plResult InitPlatform(plGALDevice* pDevice) = 0;
29 virtual plResult DeInitPlatform(plGALDevice* pDevice) = 0;
30
31 plGALRenderTargets m_RenderTargets;
32 plSizeU32 m_CurrentSize = {};
33};
34PL_DECLARE_REFLECTABLE_TYPE(PL_RENDERERFOUNDATION_DLL, plGALSwapChain);
35
36
37class PL_RENDERERFOUNDATION_DLL plGALWindowSwapChain : public plGALSwapChain
38{
39public:
41 static void SetFactoryMethod(Functor factory);
42
44
45public:
46 const plGALWindowSwapChainCreationDescription& GetWindowDescription() const { return m_WindowDesc; }
47
48protected:
50
51protected:
52 static Functor s_Factory;
53
54protected:
56};
57PL_DECLARE_REFLECTABLE_TYPE(PL_RENDERERFOUNDATION_DLL, plGALWindowSwapChain);
58
59#include <RendererFoundation/Device/Implementation/SwapChain_inl.h>
The plRenderDevice class is the primary interface for interactions with rendering APIs It contains a ...
Definition Device.h:19
Base class for GAL objects, stores a creation description of the object and also allows for reference...
Definition RendererFoundationDLL.h:374
Definition RendererFoundationDLL.h:397
Definition SwapChain.h:11
Definition RendererFoundationDLL.h:411
Definition SwapChain.h:38
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
A generic delegate class which supports static functions and member functions.
Definition Delegate.h:76
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Definition RenderTargetSetup.h:9
Definition Descriptors.h:20
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54