summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/RenderSurface.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Graphics/RenderSurface.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/Graphics/RenderSurface.h')
-rw-r--r--Runtime/Graphics/RenderSurface.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/Runtime/Graphics/RenderSurface.h b/Runtime/Graphics/RenderSurface.h
new file mode 100644
index 0000000..c856a39
--- /dev/null
+++ b/Runtime/Graphics/RenderSurface.h
@@ -0,0 +1,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;
+}