MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / drawLine

Method drawLine

source/windowing/StarGuiContext.cpp:177–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177void GuiContext::drawLine(Vec2F const& begin, Vec2F const end, Vec4B const& color, float lineWidth) {
178 Vec2F left = vnorm(Vec2F(end) - Vec2F(begin)).rot90() * lineWidth / 2.0f;
179 renderer()->immediatePrimitives().emplace_back(std::in_place_type_t<RenderQuad>(),
180 begin + left,
181 begin - left,
182 end - left,
183 end + left,
184 color, 0.0f);
185}
186
187void GuiContext::drawPolyLines(PolyF const& poly, Vec4B const& color, float lineWidth) {
188 for (size_t i = 0; i < poly.sides(); ++i)

Callers 3

makeMethod · 0.45
renderWireMethod · 0.45
renderDebugMethod · 0.45

Calls 3

vnormFunction · 0.85
rot90Method · 0.80
emplace_backMethod · 0.45

Tested by

no test coverage detected