Support retrieving the raw canvas from vecr::renderer
This commit is contained in:
parent
f70cdf9d8e
commit
1bd3f30be4
2 changed files with 15 additions and 0 deletions
|
|
@ -26,6 +26,9 @@ namespace psemek::vecr
|
||||||
gfx::pixmap_rgba const & result() const;
|
gfx::pixmap_rgba const & result() const;
|
||||||
gfx::pixmap_rgba release();
|
gfx::pixmap_rgba release();
|
||||||
|
|
||||||
|
gfx::pixmap_rgba const & canvas() const;
|
||||||
|
gfx::pixmap_rgba release_canvas();
|
||||||
|
|
||||||
void clear(gfx::color_rgba const & color = {0, 0, 0, 0});
|
void clear(gfx::color_rgba const & color = {0, 0, 0, 0});
|
||||||
|
|
||||||
void draw(primitive const & primitive);
|
void draw(primitive const & primitive);
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,18 @@ namespace psemek::vecr
|
||||||
return std::move(result_);
|
return std::move(result_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gfx::pixmap_rgba const & renderer::canvas() const
|
||||||
|
{
|
||||||
|
return canvas_;
|
||||||
|
}
|
||||||
|
|
||||||
|
gfx::pixmap_rgba renderer::release_canvas()
|
||||||
|
{
|
||||||
|
result_.clear();
|
||||||
|
need_resolve_ = false;
|
||||||
|
return std::move(canvas_);
|
||||||
|
}
|
||||||
|
|
||||||
void renderer::clear(gfx::color_rgba const & color)
|
void renderer::clear(gfx::color_rgba const & color)
|
||||||
{
|
{
|
||||||
canvas_.fill(color);
|
canvas_.fill(color);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue