Skip to content

aowlspt_widget.h

Source: abi/aowlspt_widget.h — 642 lines, 40 file-scope functions.

What this header owns

Reproduced verbatim from the header's own banner comment — these notes are frequently the only written record of why the subsystem is shaped the way it is.

text
 aowlspt_widget.h -- THE NATIVE SURFACE BEHIND THE DRAGGABLE F3 WIDGETS.

Three unrelated things live here because all three are the same KIND of
thing: a plain Win32 or same-module read that the Nim overlay needs, that
touches NO managed memory, resolves NO IL2CPP name, installs NO detour and
therefore cannot be the thing that kills the client.

  1. THE POINTER. Cursor position in the game window's CLIENT pixels, and
     left-button press / hold / release edges.

  2. MEMORY. The process working set and private bytes, and the machine's
     committed load, for the `mem` widget.

  3. THE REGION VIEW. A read-only flattening of `abi/aowlspt_region.h`'s
     participant table -- name, budget, last, max, calls, skipped, and the
     throttled/disabled/faulted state -- so the profiler widget can show
     BUDGET vs ACTUAL for every participant.

---------------------------------------------------------------------------
WHY THE POINTER IS READ AND NOT HOOKED, AND WHY THAT SETTLES THE F3 QUESTION
---------------------------------------------------------------------------

`abi/aowlspt_overlay.h` records, at length, a bug that cost a session: F10
never reached the D3D overlay's wndproc, because Windows classifies F10 as
the menu key and delivers it as WM_SYSKEYDOWN, not WM_KEYDOWN. A switch that
handled only WM_KEYDOWN therefore never saw it, and the harness had been
testing by synthesising a message the OS does not produce for that key.

NOTHING IN THIS FILE, AND NOTHING IN THE F3 OVERLAY, READS A WINDOW MESSAGE.
`GetAsyncKeyState` and `GetCursorPos` read the system's asynchronous input
state, which the raw input thread updates BEFORE any message is created or
dispatched. There is no WM_KEYDOWN/WM_SYSKEYDOWN classification to get wrong
because no classification happens: the key is either physically down or it is
not. That is also why the F3 panel keeps working while the D3D overlay's
wndproc is swallowing every WM_KEYDOWN for its own panel -- the async table
is not on that path either.

This is an argument, not a measurement, so the overlay MEASURES it: the first
time the toggle key's edge fires, `debugui` logs the route that saw it and
the virtual-key code. If that line never appears, the key never arrived, and
the answer is in the log rather than in someone's model of Windows.

THE FOREGROUND CHECK is what stops all of this from being a global input
grab: the pointer is only ever sampled while the foreground window belongs to
THIS process (`aowl_du_foreground` in aowlspt_debugui.h), so dragging a widget
can never be triggered by a click in another application.

---------------------------------------------------------------------------
SAFETY
---------------------------------------------------------------------------

No allocation, on any path. Every buffer here is a file-scope fixed array.
No guard is armed: this file is called from inside the ONE `aowl_p_p_seh`
the overlay body already holds, and `aowl_p_p_seh` is not re-entrant -- a
nested guard would DISARM the outer one rather than add anything.
Every loop is bounded by a compile-time constant.

Constants

  • AOWLSPT_WIDGET_H
  • AOWL_WG_STAGEW_MAX
  • AOWL_WG_STAGE_MAX

Types

  • struct AowlWgPmc

Functions

SignatureLine
int32_t aowl_wg_mouse_apply(int32_t focused, int32_t haveRect, int32_t x, int32_t y, int32_t w, int32_t h, int32_t down)118
int32_t aowl_wg_mouse_sample(void)161
int32_t aowl_wg_mouse_ok(void)182
int32_t aowl_wg_mouse_x(void)183
int32_t aowl_wg_mouse_y(void)184
int32_t aowl_wg_client_w(void)185
int32_t aowl_wg_client_h(void)186
int32_t aowl_wg_lmb_held(void)187
int32_t aowl_wg_lmb_pressed(void)188
int32_t aowl_wg_lmb_released(void)189
int32_t aowl_wg_window_size(int32_t* w, int32_t* h)209
int32_t aowl_wg_window_w(void)232
int32_t aowl_wg_window_h(void)236
int32_t aowl_wg_ctrl_down(void)242
void aowl_wg_mem_sample(void)278
int64_t aowl_wg_ws(void)308
int64_t aowl_wg_priv(void)309
int64_t aowl_wg_sysload(void)310
int64_t aowl_wg_sysfree(void)311
int64_t aowl_wg_st_us(int64_t ticks)497
void aowl_wg_st_charge(void)502
void aowl_wg_crumb(int32_t stage)518
void aowl_wg_crumb_w(int32_t idx)523
int32_t aowl_wg_crumb_get(void)527
int32_t aowl_wg_crumb_get_w(void)528
void aowl_wg_stage_begin(void)530
void aowl_wg_stage_end(void)545
int64_t aowl_wg_stage_frames(void)574
int32_t aowl_wg_stage_count(void)575
int32_t aowl_wg_stage_wcount(void)576
int64_t aowl_wg_stage_backwards(void)577
int64_t aowl_wg_stage_us(int32_t i)579
int64_t aowl_wg_stage_peak_us(int32_t i)583
int64_t aowl_wg_stage_worst_us(int32_t i)587
int64_t aowl_wg_stage_w_us(int32_t i)591
int64_t aowl_wg_stage_w_peak_us(int32_t i)595
int64_t aowl_wg_stage_frame_us(void)599
int64_t aowl_wg_stage_worst_total_us(void)603
void aowl_wg_stage_reset(void)608
char aowl_wg_crumb_text(int32_t s)621

aoughwl — self-hosted platform for things n stuff. Contact / Support on Discord for access to the private backends.