So, I have a minimap, which looks like this at the moment:
It's made out of three other images; the level itself, the mask defining which part of it should draw, and the border.
Currently it's being drawn inside of a render texture every time it changes, the result of which is then used to draw the minimap itself. The drawing looks something like this:
void UI::drawMap(sf::RenderTarget& target, const sf::IntRect& pos, bool redraw) const
{
if (redraw)
{
tex.clear(sf::Color::Transparent);
sf::Sprite mask(mapMask);
tex.draw(mask, sf::RenderStates(sf::BlendAdd));
sf::Sprite mini(levelTexture, pos);
mini.setScale(175.f/pos.width, 175.f/pos.height);
tex.draw(mini, sf::RenderStates(sf::BlendMultiply));
tex.display();
}
sf::Sprite map(tex.getTexture());
map.setPosition(target.getView().getSize().x - tex.getSize().x - 12.f, 12.f);
target.draw(map);
}
This works for now. Though seeing as I have done similar things inside of OpenGL applications without having to use a render texture, I'd rather change the rendering into something that is a bit friendlier to computers that don't take them so well.
Like the laptop I'm developing it on. (Right now, around 8-12ms is spent redrawing the minimap every time it changes. And more ui parts that need blending in a way like this are coming)