new widgets

This commit is contained in:
IlyaShurupov 2024-06-19 22:17:18 +03:00
parent 3dce41ea39
commit 8f62c8f387
18 changed files with 373 additions and 43 deletions

View file

@ -70,6 +70,9 @@ namespace tp {
void processEvent();
[[nodiscard]] const Vec2F& getPointer() const;
[[nodiscard]] const Vec2F& getPointerPrev() const;
[[nodiscard]] Vec2F getPointerDelta() const;
[[nodiscard]] bool isPressed(InputID id) const;
[[nodiscard]] bool isReleased(InputID id) const;
[[nodiscard]] bool isDown(InputID id) const;
@ -85,6 +88,8 @@ namespace tp {
// input states
Vec2F mPointer;
Vec2F mPointerPrev;
halnf mPointerPressure = 0;
InputState mInputStates[(int) InputID::LAST_KEY_CODE]{};

View file

@ -12,7 +12,7 @@ namespace tp {
~Window();
public:
static Window* createWindow(Vec2F size = { 1000.f, 900.f }, const char* title = "Window");
static Window* createWindow(Vec2F size = { 500.f, 500.f }, const char* title = "Window");
static void destroyWindow(Window* window);
public: