andlabs / andlabs/libui

API to know when to call `uiMainStep`

Open
#117 9 comments 0 reactions 0 assignees View on GitHub
custom main loops
Dominant language
C
Stars
10.9k
Forks
612
PR merge metrics
No merged PRs in 30d

Description

Instead of calling `uiMainStep` on some arbitrary timer, provide a way know when to step next.

I'd suggest a function that returns both:
1. a file descriptor (unix) or `HANDLE` (windows) to wait on
2. a timeout

These would then be passed (by the user) to `poll`/`select`(unix)/`WaitForMultipleObjects`(windows) to multiplex the UI with other (e.g. network) resources.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing uiMainStep API and how callers currently schedule it. Review the platform-specific event-loop behavior around poll/select on Unix and WaitForMultipleObjects on Windows. Done means a documented API exposes the required wait handle and timeout so users can multiplex UI events with other resources.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.