mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Initial commit, showing ui above target window
This commit is contained in:
16
include/gui/Button.hpp
Normal file
16
include/gui/Button.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Widget.hpp"
|
||||
#include <string>
|
||||
|
||||
namespace gsr {
|
||||
class Button : public Widget {
|
||||
public:
|
||||
Button(mgl::vec2f size);
|
||||
void on_event(mgl::Event &event, mgl::Window &window) override;
|
||||
void draw(mgl::Window &window) override;
|
||||
private:
|
||||
mgl::vec2f size;
|
||||
bool mouse_inside = false;
|
||||
};
|
||||
}
|
||||
21
include/gui/Widget.hpp
Normal file
21
include/gui/Widget.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <mglpp/system/vec.hpp>
|
||||
|
||||
namespace mgl {
|
||||
class Event;
|
||||
class Window;
|
||||
}
|
||||
|
||||
namespace gsr {
|
||||
class Widget {
|
||||
public:
|
||||
virtual ~Widget() = default;
|
||||
|
||||
virtual void on_event(mgl::Event &event, mgl::Window &window) = 0;
|
||||
virtual void draw(mgl::Window &window) = 0;
|
||||
virtual void set_position(mgl::vec2f position);
|
||||
protected:
|
||||
mgl::vec2f position;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user