ogl_beamforming

Ultrasound Beamforming Implemented with OpenGL
git clone anongit@rnpnr.xyz:ogl_beamforming.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

Commit: 023e3a3aaf9cbc286e0115cd6f2b1455db38ce5a
Parent: 6663671cc97b6006bec8088a9b2deae9dff048fe
Author: Randy Palamar
Date:   Fri, 12 Jun 2026 07:54:08 -0600

util: add os_push_input_event helper

Diffstat:
Mmain_linux.c | 6+++---
Mmain_w32.c | 6+++---
Mutil_os_ui.c | 8++++++++
3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/main_linux.c b/main_linux.c @@ -294,7 +294,7 @@ dispatch_file_watch_events(BeamformerInput *input) input_event.kind = BeamformerInputEventKind_FileEvent; input_event.file_watch_user_context = fw->user_context; } - input->event_queue[input->event_count++] = input_event; + os_push_input_event(input, input_event); } fw->update_time = current_time; break; @@ -328,9 +328,9 @@ main(void) input->shared_memory_name_length = s8(OS_SHARED_MEMORY_NAME).len; } - input->event_queue[input->event_count++] = (BeamformerInputEvent){ + os_push_input_event(input, (BeamformerInputEvent){ .kind = BeamformerInputEventKind_ExecutableReload, - }; + }); load_platform_libraries(input); diff --git a/main_w32.c b/main_w32.c @@ -345,7 +345,7 @@ dispatch_file_watch(BeamformerInput *input, Arena arena, u64 current_time, OSW32 input_event.kind = BeamformerInputEventKind_FileEvent; input_event.file_watch_user_context = fw->user_context; } - input->event_queue[input->event_count++] = input_event; + os_push_input_event(input, input_event); } fw->update_time = current_time; break; @@ -409,9 +409,9 @@ main(void) input->shared_memory_name_length = s8(OS_SHARED_MEMORY_NAME).len; } - input->event_queue[input->event_count++] = (BeamformerInputEvent){ + os_push_input_event(input, (BeamformerInputEvent){ .kind = BeamformerInputEventKind_ExecutableReload, - }; + }); load_platform_libraries(input); diff --git a/util_os_ui.c b/util_os_ui.c @@ -4,6 +4,14 @@ // otherwise share implementation function void +os_push_input_event(BeamformerInput *input, BeamformerInputEvent event) +{ + assert(input->event_count < countof(input->event_queue)); + if (input->event_count < countof(input->event_queue)) + input->event_queue[input->event_count++] = event; +} + +function void os_build_frame_input(BeamformerInput *input) { Vector2 new_mouse = {-1, -1};