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/debugLineRenderD3D11.h | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 demo/d3d11/debugLineRenderD3D11.h (limited to 'demo/d3d11/debugLineRenderD3D11.h') diff --git a/demo/d3d11/debugLineRenderD3D11.h b/demo/d3d11/debugLineRenderD3D11.h new file mode 100644 index 0000000..1509065 --- /dev/null +++ b/demo/d3d11/debugLineRenderD3D11.h @@ -0,0 +1,42 @@ +#pragma once + +#include +#include "core/maths.h" + +#include +using namespace Microsoft::WRL; + +struct DebugLineRenderD3D11 +{ + struct Vertex + { + Vec3 position; + Vec4 color; + }; + + void init(ID3D11Device* d, ID3D11DeviceContext* c); + void addLine(const Vec3& p, const Vec3& q, const Vec4& color); + void flush(const Matrix44& viewProj); + + DebugLineRenderD3D11(): + m_vertexBufferSize(0), + m_device(nullptr), + m_context(nullptr) + {} + + std::vector m_queued; + + ComPtr m_vertexBuffer; + int m_vertexBufferSize; + + ComPtr m_depthStencilState; + ComPtr m_rasterizerState; + ComPtr m_inputLayout; + ComPtr m_blendState; + ComPtr m_vertexShader; + ComPtr m_pixelShader; + ComPtr m_constantBuffer; + + ID3D11Device* m_device; + ID3D11DeviceContext* m_context; +}; \ No newline at end of file -- cgit v1.2.3