aboutsummaryrefslogtreecommitdiff
path: root/include/RoundedRectangle.hpp
blob: f72a083a042df98795056524d87e1f0443305875 (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
#pragma once

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

namespace sf {
    class RenderWindow;
    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);
        sf::Vector2f get_position() const;
        sf::Vector2f get_size() const;
        void draw(sf::RenderWindow &window);
    private:
        float radius;
        sf::Vector2f pos;
        sf::Vector2f size;
        sf::Vertex vertices[4];
        sf::Shader *rounded_rectangle_shader;
    };
}