aboutsummaryrefslogtreecommitdiff
path: root/include/RoundedRectangle.hpp
blob: 2106634faecfaa00b11ca458854d7e6e01136a53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

#include <SFML/System/Vector2.hpp>
#include <SFML/Graphics/Vertex.hpp>

namespace sf {
    class RenderTarget;
    class Shader;
}

namespace QuickMedia {
    class RoundedRectangle {
    public:
        RoundedRectangle(sf::Vector2f size, float radius, sf::Color color, sf::Shader *rounded_rectangle_shader);
        void set_position(sf::Vector2f pos);
        void set_size(sf::Vector2f size);
        void set_color(sf::Color color);
        sf::Vector2f get_position() const;
        sf::Vector2f get_size() const;
        void set_band(sf::Vector2f pos, sf::Vector2f size);
        void set_band_color(sf::Color color);
        void draw(sf::RenderTarget &target);
    private:
        float radius;
        sf::Vector2f pos;
        sf::Vector2f size;
        sf::Vertex vertices[4];
        sf::Shader *rounded_rectangle_shader;
        sf::Vector2f band_pos;
        sf::Vector2f band_size;
        sf::Color band_color;
    };
}