#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; };