diff --git a/extern/glow b/extern/glow index aaf5f23b57cfd260efdaa2c1e7787415e9960c86..a0f727567041516347439d73795636d1aee12df2 160000 --- a/extern/glow +++ b/extern/glow @@ -1 +1 @@ -Subproject commit aaf5f23b57cfd260efdaa2c1e7787415e9960c86 +Subproject commit a0f727567041516347439d73795636d1aee12df2 diff --git a/extern/glow-extras b/extern/glow-extras index 22266479a99ff82946ee7eb698166a548fcf77c9..4a664b557fb3e417b85d5b6eb4ca1e5f72df78d6 160000 --- a/extern/glow-extras +++ b/extern/glow-extras @@ -1 +1 @@ -Subproject commit 22266479a99ff82946ee7eb698166a548fcf77c9 +Subproject commit 4a664b557fb3e417b85d5b6eb4ca1e5f72df78d6 diff --git a/extern/polymesh b/extern/polymesh index 8780b1de6fe379af2f0162d68f26de2fb55ea52c..6c22fa0315f450b7dbd48b5555fbbff2a80c6bcd 160000 --- a/extern/polymesh +++ b/extern/polymesh @@ -1 +1 @@ -Subproject commit 8780b1de6fe379af2f0162d68f26de2fb55ea52c +Subproject commit 6c22fa0315f450b7dbd48b5555fbbff2a80c6bcd diff --git a/samples/wip/vector-2D/Vector2DSample.cc b/samples/wip/vector-2D/Vector2DSample.cc index 9b2e7b3763b1975778e80270f96964dd921ce6e8..a45958ae11ee365dfc3400ab1ff913301586ea9c 100644 --- a/samples/wip/vector-2D/Vector2DSample.cc +++ b/samples/wip/vector-2D/Vector2DSample.cc @@ -45,11 +45,56 @@ void Vector2DSample::render(float elapsedSeconds) glow::vector::image2D img; auto g = graphics(img); - g.draw(tg::pos2(100, 100), {tg::color3::blue, 5.0f}); + // ways to specify a brush + g.draw(tg::pos2(100, 100), tg::color3::blue); + g.draw(tg::pos2(110, 100), tg::color4::blue); + g.draw(tg::pos2(120, 100), {1, 0, 0}); + g.draw(tg::pos2(130, 100), {1, 0, 0, 1}); + g.draw(tg::pos2(140, 100), {tg::color3::blue, 5.0f}); + g.draw(tg::pos2(150, 100), {tg::color4::blue, 5.0f}); + g.draw(tg::pos2(160, 100), {{1, 0, 0}, 5.0f}); + g.draw(tg::pos2(170, 100), {{1, 0, 0, 1}, 5.0f}); + + // ways to speficy a fill + g.fill(tg::aabb2({100, 120}, {150, 125}), tg::color3::green); + g.fill(tg::aabb2({100, 130}, {150, 135}), tg::color4::green); + g.fill(tg::aabb2({100, 140}, {150, 145}), {1, 0, 0}); + g.fill(tg::aabb2({100, 150}, {150, 155}), {1, 0, 0, 1}); + + // line drawings g.draw(tg::segment2({110, 100}, {80, 80}), tg::color3::red); - g.fill(tg::aabb2({70, 10}, {100, 20}), tg::color3::green); - g.draw(tg::aabb2({70, 10}, {100, 20}), {{0, 0, 0}, 3}); + // fillings + + // other objects + { + float x = 250; + float y = 100; + auto next = [&] { + x += 100; + if (x > 1000) + { + x = 250; + y += 100; + } + }; + + g.draw(tg::aabb2({x - 20, y - 10}, {x + 20, y + 10}), {{0, 0, 0}, 3}); + g.fill(tg::aabb2({x - 20, y - 10}, {x + 20, y + 10}), tg::color3::green); + next(); + + g.draw(tg::triangle2({x - 20, y - 10}, {x + 10, y - 20}, {x, y + 20}), {{0, 0, 0}, 2}); + g.fill(tg::triangle2({x - 20, y - 10}, {x + 10, y - 20}, {x, y + 20}), {0, 0, 1}); + next(); + + g.draw(tg::sphere2({x, y}, 15.f), {{0, 0, 0}, 2}); + g.fill(tg::sphere2({x, y}, 15.f), {0, 0, 1}); + next(); + + g.draw(tg::circle2({x, y}, 15.f), {{0, 0, 0}, 2}); + g.fill(tg::circle2({x, y}, 15.f), {0, 0, 1}); + next(); + } // TODO: more