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
10
class
PL_RENDERERFOUNDATION_DLL
plGALSwapChain
:
public
plGALObject
<plGALSwapChainCreationDescription>
11
{
12
public
:
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
23
protected
:
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
};
34
PL_DECLARE_REFLECTABLE_TYPE(PL_RENDERERFOUNDATION_DLL,
plGALSwapChain
);
35
36
37
class
PL_RENDERERFOUNDATION_DLL
plGALWindowSwapChain
:
public
plGALSwapChain
38
{
39
public
:
40
using
Functor
=
plDelegate
<
plGALSwapChainHandle
(
const
plGALWindowSwapChainCreationDescription
&)>;
41
static
void
SetFactoryMethod(
Functor
factory);
42
43
static
plGALSwapChainHandle
Create(
const
plGALWindowSwapChainCreationDescription
& desc);
44
45
public
:
46
const
plGALWindowSwapChainCreationDescription
& GetWindowDescription()
const
{
return
m_WindowDesc; }
47
48
protected
:
49
plGALWindowSwapChain
(
const
plGALWindowSwapChainCreationDescription
& Description);
50
51
protected
:
52
static
Functor
s_Factory;
53
54
protected
:
55
plGALWindowSwapChainCreationDescription
m_WindowDesc;
56
};
57
PL_DECLARE_REFLECTABLE_TYPE(PL_RENDERERFOUNDATION_DLL,
plGALWindowSwapChain
);
58
59
#include <RendererFoundation/Device/Implementation/SwapChain_inl.h>
plGALDevice
The plRenderDevice class is the primary interface for interactions with rendering APIs It contains a ...
Definition
Device.h:19
plGALObject
Base class for GAL objects, stores a creation description of the object and also allows for reference...
Definition
RendererFoundationDLL.h:374
plGALSwapChainHandle
Definition
RendererFoundationDLL.h:397
plGALSwapChain
Definition
SwapChain.h:11
plGALTextureHandle
Definition
RendererFoundationDLL.h:411
plGALWindowSwapChain
Definition
SwapChain.h:38
plRTTI
This class holds information about reflected types. Each instance represents one type that is known t...
Definition
RTTI.h:30
plSizeTemplate< plUInt32 >
plDelegate
A generic delegate class which supports static functions and member functions.
Definition
Delegate.h:76
plEnum
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition
Enum.h:37
plGALRenderTargets
Definition
RenderTargetSetup.h:9
plGALWindowSwapChainCreationDescription
Definition
Descriptors.h:20
plResult
Default enum for returning failure or success, instead of using a bool.
Definition
Types.h:54
Code
Engine
RendererFoundation
Device
SwapChain.h
Generated by
1.11.0