MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / DrawVert

Method DrawVert

Source/Graphics/pxdebugdraw.cpp:829–851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827}
828
829void DebugDrawWire::DrawVert() {
830 Graphics *graphics = Graphics::Instance();
831 Shaders *shaders = Shaders::Instance();
832 Camera *cam = ActiveCameras::Get();
833
834 graphics->SetLineWidth(1);
835
836 int shader_id = shaders->returnProgram("3d_color #COLOR_UNIFORM #NO_VELOCITY_BUF");
837 shaders->setProgram(shader_id);
838 int vert_attrib_id = shaders->returnShaderAttrib("vert_attrib", shader_id);
839 shaders->SetUniformMat4("mvp", cam->GetProjMatrix() * cam->GetViewMatrix() * transform);
840 shaders->SetUniformVec4("color_uniform", color);
841 shaders->SetUniformFloat("opacity", opacity * (1.0f - fade_amount));
842
843 graphics->EnableVertexAttribArray(vert_attrib_id);
844
845 vbo->Bind();
846 glVertexAttribPointer(vert_attrib_id, 3, GL_FLOAT, false, sizeof(float) * 3, (const void *)0);
847
848 graphics->DrawArrays(GL_LINES, 0, vbo->size() / sizeof(float) / 3);
849
850 graphics->ResetVertexAttribArrays();
851}
852
853void DebugDrawWire::DrawVertColor() {
854 Graphics *graphics = Graphics::Instance();

Callers

nothing calls this directly

Calls 15

SetLineWidthMethod · 0.80
returnProgramMethod · 0.80
setProgramMethod · 0.80
returnShaderAttribMethod · 0.80
SetUniformMat4Method · 0.80
GetProjMatrixMethod · 0.80
GetViewMatrixMethod · 0.80
DrawArraysMethod · 0.80
GetFunction · 0.50
SetUniformVec4Method · 0.45

Tested by

no test coverage detected