MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / DrawRectDecal

Method DrawRectDecal

olcPixelGameEngine.h:3798–3809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3796 }
3797
3798 void PixelGameEngine::DrawRectDecal(const olc::vf2d& pos, const olc::vf2d& size, const olc::Pixel col)
3799 {
3800 auto m = nDecalMode;
3801 SetDecalMode(olc::DecalMode::WIREFRAME);
3802 olc::vf2d vNewSize = size;// (size - olc::vf2d(0.375f, 0.375f)).ceil();
3803 std::array<olc::vf2d, 4> points = { { {pos}, {pos.x, pos.y + vNewSize.y}, {pos + vNewSize}, {pos.x + vNewSize.x, pos.y} } };
3804 std::array<olc::vf2d, 4> uvs = { {{0,0},{0,0},{0,0},{0,0}} };
3805 std::array<olc::Pixel, 4> cols = { {col, col, col, col} };
3806 DrawExplicitDecal(nullptr, points.data(), uvs.data(), cols.data(), 4);
3807 SetDecalMode(m);
3808
3809 }
3810
3811 void PixelGameEngine::FillRectDecal(const olc::vf2d& pos, const olc::vf2d& size, const olc::Pixel col)
3812 {

Callers

nothing calls this directly

Calls 1

SetDecalModeFunction · 0.85

Tested by

no test coverage detected