nx_desktop_game.nx
buildroot/runtime/nx_desktop_game.nx
about
nx_desktop_game.nx -- the shared NATIVE GAME SURFACE (no wasm, no JS, no third-party anything):
window + server keymap + event pump into nx_input_abstract + banded framebuffer blit, extracted
from nx_desktop_breeders the moment a second native client (craft) needed the same machinery --
migrate-on-touch, one definition. A client composes: dg_setup -> dg_keymap -> loop { dg_pump ->
its own step/render -> dg_blit } -- the game organ stays byte-identical to its wasm build; only
the surface differs. dg_prove_surface is the shared selftest core (blit accepted + pixmap put->get
byte round-trip) so every client's proof battery stays honest without re-implementing it.
license_tier: ORIGINAL
dependencies 7 imports · 2 importers
imports: nx_syscalls.nxnx_x11_paint.nxnx_x11_pixmap.nxnx_x11_get_image.nxnx_x11_put_image.nxnx_x11_keyboard.nxnx_input_abstract.nx
imported by: nx_desktop_breeders.nxnx_desktop_craft.nx
structs
| none |
consts
| 16 | const DG_MAGIC_4096: i64 = 4096 |
| 18 | const DG_FRAME_MS: i64 = 33 |
functions
| 21 | func dg_poll_in(pfd: *u8, fd: i64, timeout_ms: i64) -> i64 |
| 38 | func dg_dispatch(inp: *i64, ev: *u8, vk_table: *i64) -> i64 |
| 56 | func dg_pump(conn: *X11Conn, inp: *i64, ev: *u8, pfd: *u8, vk_table: *i64) -> i64 |
| 72 | func dg_dispatch2(inp: *i64, ev: *u8, vk_table: *i64, mctx: *i64) -> i64 |
| 101 | func dg_pump2(conn: *X11Conn, wid: i64, w: i64, h: i64, |
| 122 | func dg_blit(conn: *X11Conn, wid: i64, gc: i64, fbp: *i64, w: i64, h: i64, zbuf: *u8) -> i64 |
| 129 | func dg_setup(title: *u8, tlen: i64, w: i64, h: i64, out: *i64) -> i64 |
| 149 | func dg_kc_for(vk_table: *i64, vk: i64) -> i64 |
| 161 | func dg_prove_surface(conn: *X11Conn, wid: i64, gc: i64, fbp: *i64, |
| 184 | func main() -> i64 |