From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Graphics/RenderSurface.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Runtime/Graphics/RenderSurface.h (limited to 'Runtime/Graphics/RenderSurface.h') 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; +} -- cgit v1.1-26-g67d0