Started to setup input events based off sokol

Will replace the input polling done with raylib.

Going to also provide the more robust input tracking for consuming events with the UI interactions
This commit is contained in:
2024-06-17 03:35:53 -04:00
parent 05ffaf432d
commit 425a642fd3
16 changed files with 382 additions and 52 deletions

View File

@ -0,0 +1,3 @@
package sectr

View File

@ -252,8 +252,8 @@ ui_screen_settings_menu :: proc( captures : rawptr = nil ) -> ( should_raise : b
}
if input_box.active {
array_append( & value_str, input.keyboard_events.chars_pressed )
array_clear( input.keyboard_events.chars_pressed )
array_append( & value_str, input.codes_pressed )
array_clear( input.codes_pressed )
}
else if input_box.was_active
{

View File

@ -210,6 +210,10 @@ State :: struct {
input_prev : ^InputState,
input : ^InputState,
// Note(Ed): Do not modify directly, use its interface in app/event.odin
staged_input_events : Array(InputEvent),
// TODO(Ed): Add a multi-threaded guard for accessing or mutating staged_input_events.
debug : DebugData,
project : Project,
@ -226,6 +230,7 @@ State :: struct {
// using frametime : FrameTime,
sleep_is_granular : b32,
frame : u64,
frametime_delta_seconds : f64,
frametime_delta_ms : f64,
frametime_delta_ns : Duration,