gui updates

This commit is contained in:
IlyaShurupov 2024-06-24 22:21:10 +03:00 committed by Ilya Shurupov
parent a55a5ec5cc
commit 4a557d7e5c
42 changed files with 1179 additions and 962 deletions

View file

@ -4,6 +4,7 @@
#include "Vec.hpp"
#include "List.hpp"
#include "Map.hpp"
#include "Timing.hpp"
#include <mutex>
@ -15,6 +16,7 @@ namespace tp {
BUTTON_ACTION,
MOUSE_DELTA,
MOUSE_POS,
SCROLL,
} type = Type::NONE;
enum class ButtonAction {
@ -26,6 +28,7 @@ namespace tp {
} buttonAction = ButtonAction::NONE;
Vec2F mouseEvent = { 0, 0 };
Vec2F scrollDelta = { 0, 0 };
};
class InputState {
@ -89,10 +92,13 @@ namespace tp {
// input states
Vec2F mPointer;
Vec2F mPointerPrev;
Vec2F mScrollDelta;
halnf mPointerPressure = 0;
InputState mInputStates[(int) InputID::LAST_KEY_CODE]{};
Timer mTimerEvent = Timer(1000);
};
}

View file

@ -17,8 +17,8 @@ namespace tp {
explicit DebugGUI(Window* window);
~DebugGUI();
void procBegin() {}
void procEnd() {}
void procBegin();
void procEnd();
void drawBegin();
void drawEnd();

View file

@ -143,8 +143,10 @@ namespace tp {
MOUSE4 = 504,
MOUSE5 = 505,
LAST_KEY_CODE = 508,
SCROLL,
WINDOW_RESIZE = 1000,
WINDOW_RESIZE,
LAST_KEY_CODE,
};
}

View file

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