zephr/os/windows: most events are done, just have to map scancodes and handle modifiers

This commit is contained in:
2024-01-25 07:14:39 +02:00
parent 69593caf8b
commit e201f6c940
3 changed files with 364 additions and 17 deletions
+6 -2
View File
@@ -3,6 +3,7 @@ package zephr
import "core:fmt"
import "core:log"
import "core:os"
import "core:container/queue"
import x11 "vendor:x11/xlib"
import gl "vendor:OpenGL"
@@ -354,14 +355,13 @@ Context :: struct {
mouse: Mouse,
keyboard: Keyboard,
cursor: Cursor,
event_queue: queue.Queue(OsEvent),
//cursors: [Cursor]x11.Cursor,
ui: Ui,
/* ZephrKeyboard keyboard; */
/* XkbDescPtr xkb; */
/* XIM xim; */
/* CoreStack(ZephrEvent) event_queue; */
/* u32 event_queue_cursor; */
projection: Mat4,
}
@@ -372,6 +372,8 @@ FNV_HASH32_INIT :: 0x811c9dc5
FNV_HASH32_PRIME :: 0x01000193
@private
INIT_UI_STACK_SIZE :: 256
@private
EVENT_QUEUE_INIT_CAP :: 128
when ODIN_DEBUG {
@private
@@ -652,6 +654,8 @@ init :: proc(font_path: cstring, icon_path: cstring, window_title: cstring, wind
//int res = audio_init();
//CORE_ASSERT(res == 0, "Failed to initialize audio");
queue.init(&zephr_ctx.event_queue, EVENT_QUEUE_INIT_CAP)
backend_init(window_title, window_size, icon_path, window_non_resizable)
ui_init(font_path)