aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 07e799b..9d201a1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -67,6 +67,7 @@ int main() {
start = std::chrono::high_resolution_clock::now();
ImGuiIO& io = ImGui::GetIO();
+ io.DeltaTime = delta_time;
wnd.poll_events();
@@ -129,6 +130,31 @@ int main() {
break;
}
+ case EVENT_TYPES::BUTTON_PRESS: {
+ if (event.button == BUTTONS::LEFT) {
+ io.MouseDown[0] = true;
+ }
+ if (event.button == BUTTONS::RIGHT) {
+ io.MouseDown[1] = true;
+ }
+ break;
+ }
+ case EVENT_TYPES::BUTTON_RELEASE: {
+ if (event.button == BUTTONS::LEFT) {
+ io.MouseDown[0] = false;
+ }
+ if (event.button == BUTTONS::RIGHT) {
+ io.MouseDown[1] = false;
+ }
+ break;
+ }
+ case EVENT_TYPES::MOUSE_MOVE: {
+ io.MousePos = ImVec2 {
+ (float)event.x,
+ (float)event.y
+ };
+ break;
+ }
default:
break;
}