This commit is contained in:
Riyyi
2026-09-14 23:00:24 +02:00
parent 416b42c27e
commit e7cc935035
5 changed files with 51 additions and 12 deletions
+7 -6
View File
@@ -9,7 +9,8 @@ import "sindri:input"
// event category, bitfield (?)
Event_Data :: union {
// Event_Data :: union {
Event :: union {
Window_Close_Event,
Window_Resize_Event,
Joystick_Connect_Event,
@@ -23,10 +24,10 @@ Event_Data :: union {
Mouse_Scroll_Event,
}
Event :: struct {
data: Event_Data,
handled: bool,
}
// Event :: struct {
// data: Event_Data,
// handled: bool,
// }
Window_Close_Event :: struct {
handled: bool,
@@ -94,7 +95,7 @@ Mouse_Scroll_Event :: struct {
// Variables
// I want to have a list of Listeners per Event type, but this is state
listeners: map[typeid][dynamic]Listener
// listeners: map[typeid][dynamic]Listener
// -----------------------------------------
// Public functions
+4
View File
@@ -2,6 +2,7 @@ package sindri
import "core:fmt"
import "core:time"
import "sindri:test"
import "sindri:hot_reload"
import "sindri:platform"
@@ -41,6 +42,9 @@ main :: proc() {
platform.os_poll_events()
api.update(dt)
fmt.println("MAIN:", test.test)
fmt.printf("pointer: %p | %p\n", &test.test, &test.test_proc)
platform.frame(dt)
dt = f32(time.duration_seconds(time.tick_since(start)))
+5
View File
@@ -0,0 +1,5 @@
package test
test: int = 0
test_proc: proc()