aboutsummaryrefslogtreecommitdiff
path: root/include/gui
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-11-17 09:47:45 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-17 09:59:29 +0100
commit453eac7f1f5ef70390ec51087fc1f190811a7507 (patch)
tree21a32ef6de9a3d7c29562484104b56c12518a6f0 /include/gui
parentfc49d40c0d2f6edbbe9dde1f1b53d6a17e9d9f7d (diff)
Replace sfml with mgl
Diffstat (limited to 'include/gui')
-rw-r--r--include/gui/Button.hpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/gui/Button.hpp b/include/gui/Button.hpp
index ba6997b..2a22a88 100644
--- a/include/gui/Button.hpp
+++ b/include/gui/Button.hpp
@@ -2,12 +2,12 @@
#include "../RoundedRectangle.hpp"
#include <string>
-#include <SFML/Graphics/Text.hpp>
+#include <mglpp/graphics/Text.hpp>
-namespace sf {
+namespace mgl {
class Event;
class Font;
- class RenderTarget;
+ class Window;
class Shader;
}
@@ -19,21 +19,21 @@ namespace QuickMedia {
class Button {
public:
- Button(const std::string &label, sf::Font *font, unsigned int character_size, float width, sf::Shader *rounded_rectangle_shader, float scale = 1.0f);
+ Button(const std::string &label, mgl::Font *font, float width, mgl::Shader *rounded_rectangle_shader, float scale = 1.0f);
- ButtonEvent on_event(sf::Event &event);
- void draw(sf::RenderTarget &target);
+ ButtonEvent on_event(mgl::Event &event);
+ void draw(mgl::Window &target);
- void set_background_color(sf::Color color);
- void set_position(sf::Vector2f pos);
+ void set_background_color(mgl::Color color);
+ void set_position(mgl::vec2f pos);
- sf::Vector2f get_position() const;
+ mgl::vec2f get_position() const;
float get_width() const;
- float get_height() const;
+ float get_height();
private:
- sf::Text label;
+ mgl::Text label;
RoundedRectangle background;
- sf::Color background_color;
+ mgl::Color background_color;
float scale;
bool clicked_inside = false;
};