From 688b5f42e9bfe498d7af7075d4d8f4429867f3a3 Mon Sep 17 00:00:00 2001 From: Miles Macklin Date: Fri, 9 Jun 2017 13:41:15 +1200 Subject: 1.2.0.beta.1 --- demo/d3d11/renderTargetD3D11.h | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 demo/d3d11/renderTargetD3D11.h (limited to 'demo/d3d11/renderTargetD3D11.h') diff --git a/demo/d3d11/renderTargetD3D11.h b/demo/d3d11/renderTargetD3D11.h new file mode 100644 index 0000000..b299bec --- /dev/null +++ b/demo/d3d11/renderTargetD3D11.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2008-2017, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#pragma once + +#include +#include +#include + +using namespace DirectX; +using namespace Microsoft::WRL; + +#define NV_NULL nullptr +#define NV_RETURN_ON_FAIL(x) { HRESULT _res = (x); if (FAILED(_res)) { return _res; } } + +struct RenderTargetD3D11 +{ +public: + + RenderTargetD3D11(); + + HRESULT init(ID3D11Device* device, int width, int height, bool depthTest = true); + + void bindAndClear(ID3D11DeviceContext* context); + + XMMATRIX m_lightView; + XMMATRIX m_lightProjection; + XMMATRIX m_lightWorldToTex; + + ComPtr m_backTexture; + ComPtr m_backRtv; + ComPtr m_backSrv; + + ComPtr m_depthTexture; + ComPtr m_depthDsv; + ComPtr m_depthSrv; + + ComPtr m_linearSampler; + ComPtr m_pointSampler; + + ComPtr m_depthStencilState; + + D3D11_VIEWPORT m_viewport; +}; -- cgit v1.2.3