summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/RenderSurface.h
blob: c856a392f341bdb634f102dd0506a5c210e02bdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once

#include "Runtime/GfxDevice/GfxDeviceTypes.h"

struct
RenderSurfaceBase
{
	TextureID	textureID;
	int			width;
	int			height;
	int 		samples;
	UInt32		flags;
	bool		colorSurface;
	bool		backBuffer;
	bool		shouldDiscard;
	bool		shouldClear;
};

// we dont want to enforce ctor, so lets do it as simple function
inline void RenderSurfaceBase_Init(RenderSurfaceBase& rs)
{
	rs.textureID.m_ID = 0;
	rs.width = rs.height = 0;
	rs.samples = 1;
	rs.flags = 0;
	rs.shouldDiscard = rs.shouldClear = false;
	rs.backBuffer = false;
}

inline void RenderSurfaceBase_InitColor(RenderSurfaceBase& rs)
{
	RenderSurfaceBase_Init(rs);
	rs.colorSurface = true;
}

inline void RenderSurfaceBase_InitDepth(RenderSurfaceBase& rs)
{
	RenderSurfaceBase_Init(rs);
	rs.colorSurface = false;
}