MCPcopy Create free account
hub / github.com/Illation/ETEngine / Draw

Method Draw

Engine/source/EtRendering/Extensions/DebugRenderer.cpp:86–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void 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
118void DebugRenderer::CheckMetaData(float thickness)
119{

Callers

nothing calls this directly

Calls 8

SetShaderMethod · 0.80
UploadMethod · 0.80
SetBlendEnabledMethod · 0.80
SetBlendEquationMethod · 0.80
SetBlendFunctionMethod · 0.80
SetLineWidthMethod · 0.80
DrawArraysMethod · 0.80
BindVertexArrayMethod · 0.80

Tested by

no test coverage detected