| 84 | } |
| 85 | |
| 86 | void DebugRenderer::Draw(Camera const& camera) |
| 87 | { |
| 88 | if (m_Lines.size() <= 0) |
| 89 | { |
| 90 | return; |
| 91 | } |
| 92 | |
| 93 | I_GraphicsApiContext* const api = Viewport::GetCurrentApiContext(); |
| 94 | |
| 95 | api->SetShader(m_pShader.get()); |
| 96 | m_pShader->Upload("uViewProj"_hash, camera.GetViewProj()); |
| 97 | |
| 98 | UpdateBuffer(); |
| 99 | |
| 100 | api->SetBlendEnabled(true); |
| 101 | api->SetBlendEquation(E_BlendEquation::Add); |
| 102 | api->SetBlendFunction(E_BlendFactor::One, E_BlendFactor::Zero); |
| 103 | |
| 104 | for (const auto& meta : m_MetaData) |
| 105 | { |
| 106 | api->SetLineWidth(meta.thickness); |
| 107 | api->DrawArrays(E_DrawMode::Lines, meta.start, meta.size); |
| 108 | } |
| 109 | |
| 110 | api->BindVertexArray(0); |
| 111 | |
| 112 | api->SetBlendEnabled(false); |
| 113 | |
| 114 | m_Lines.clear(); |
| 115 | m_MetaData.clear(); |
| 116 | } |
| 117 | |
| 118 | void DebugRenderer::CheckMetaData(float thickness) |
| 119 | { |
nothing calls this directly
no test coverage detected