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

Method DrawVertColor

Source/Graphics/pxdebugdraw.cpp:853–877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

851}
852
853void DebugDrawWire::DrawVertColor() {
854 Graphics *graphics = Graphics::Instance();
855 Shaders *shaders = Shaders::Instance();
856 Camera *cam = ActiveCameras::Get();
857
858 graphics->SetLineWidth(1);
859
860 int shader_id = shaders->returnProgram("3d_color #COLOR_ATTRIB #NO_VELOCITY_BUF");
861 shaders->setProgram(shader_id);
862 int vert_attrib_id = shaders->returnShaderAttrib("vert_attrib", shader_id);
863 int color_attrib_id = shaders->returnShaderAttrib("color_attrib", shader_id);
864 shaders->SetUniformMat4("mvp", cam->GetProjMatrix() * cam->GetViewMatrix() * transform);
865 shaders->SetUniformFloat("opacity", opacity * (1.0f - fade_amount));
866
867 graphics->EnableVertexAttribArray(vert_attrib_id);
868 graphics->EnableVertexAttribArray(color_attrib_id);
869
870 vbo->Bind();
871 glVertexAttribPointer(vert_attrib_id, 3, GL_FLOAT, false, sizeof(float) * 7, (const void *)0);
872 glVertexAttribPointer(color_attrib_id, 4, GL_FLOAT, false, sizeof(float) * 7, (const void *)(sizeof(float) * 3));
873
874 graphics->DrawArrays(GL_LINES, 0, vbo->size() / sizeof(float) / 7);
875
876 graphics->ResetVertexAttribArrays();
877}
878
879DebugDrawStippleMesh::DebugDrawStippleMesh(const RC_VBOContainer &_vbo,
880 const mat4 &_transform,

Callers

nothing calls this directly

Calls 14

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
SetUniformFloatMethod · 0.45

Tested by

no test coverage detected