4#ifndef MALENA_CLIPVIEW_H
5#define MALENA_CLIPVIEW_H
45 const auto sz = target.
getSize();
46 const float tw =
static_cast<float>(sz.x);
47 const float th =
static_cast<float>(sz.y);
59 {tl.
x / tw, tl.
y / th},
60 {(br.
x - tl.
x) / tw, (br.
y - tl.
y) / th}
void setView(const View &view)
virtual Vector2u getSize() const=0
Vector2i mapCoordsToPixel(Vector2f point) const
const View & getView() const
void setCenter(Vector2f center)
void setSize(Vector2f size)
void setViewport(const FloatRect &viewport)
void withClipView(sf::RenderTarget &target, sf::FloatRect rect, F &&body)
Render body with an sf::View clipped to rect (world coords).