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:
3
code/sectr/app/event.odin
Normal file
3
code/sectr/app/event.odin
Normal file
@ -0,0 +1,3 @@
|
||||
package sectr
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user