moved code from header to source files

This commit is contained in:
2026-01-09 05:04:35 +05:00
parent 50940e5190
commit 3f75902aa0
20 changed files with 1304 additions and 1207 deletions

19
src/event.c Executable file
View File

@@ -0,0 +1,19 @@
#include "tim.h"
bool tim_is_event_key(TimEventType type, TimKey key) {
return tim.event.type == type && tim.event.key == key;
}
bool tim_is_key_press(TimKey key) {
return tim_is_event_key(TimEvent_Key, key);
}
bool tim_is_mouse_over(TimRect r) {
i32 x = tim.event.x;
i32 y = tim.event.y;
return x >= r.x && x < r.x + r.w && y >= r.y && y < r.y + r.h;
}
bool tim_is_mouse_click_over(TimRect r) {
return tim_is_event_key(TimEvent_Mouse, TimKey_MouseButtonLeft) && tim_is_mouse_over(r);
}