feat(windows): Http.* over WinHTTP, and the splash and window icon through WIC

http_win.ll implements http.ll's hs_* contract over WinHTTP: the request is a
record built on the game thread, the whole exchange runs on a worker thread,
TLS uses the system's certificate checks, and headers are answered from the
kept request handle. ludicc links it with winhttp instead of refusing Http.* on
Windows.

win32.ll decodes the splash and App.set_icon images with WIC (ole32): the
splash is a topmost borderless window at the artwork's size in points times the
display scale, composited over its background colour; the icon becomes an
HICON set on the window now or when win_open makes one.

Verified on the PC: examples/library/http.ludic prints its expected output, a
real GET to https://git.workshopsoft.io/ returns 200 with its body and
Content-Type, and the bundled Maroon Lake shows its splash centred at launch and
its icon in the title bar.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-13 03:24:50 +03:00
parent 55b0e2ebf6
commit 40d78cbd92
4 changed files with 988 additions and 12 deletions

View file

@ -34,8 +34,12 @@ type: feat
- **`ludic bundle` on Windows** — `build/<name>/` holding a GUI-subsystem `<name>.exe`, the
`game.lpak` and `packs.index`; an `.ico` beside `app icon` is compiled with `llvm-rc` and
linked in. `ludicc` gains `--gui` (no console behind the window) and `--link <file>`.
- **Not yet** — the splash and `App.set_icon` do nothing, and `Http.*` is still a macOS
platform layer; a Windows build that uses it stops with a message saying so.
- **`Http.*` on Windows** — `http_win.ll` is `http.ll`'s contract over WinHTTP: a request
built on the game thread, the exchange on a worker thread, TLS with the system's
certificate checks, and response headers answered from the kept request handle.
- **The splash and the window icon** — decoded by WIC from the bytes in the pack. The splash
is a topmost borderless window at the artwork's own size in points times the display's
scale; `App.set_icon` sets the title bar and taskbar icon of a build with no icon resource.
- **`Gl.*` on Windows** — `gl_win.ll` makes a WGL 4.1 core context on a hidden window's DC,
and `gl_thunks_win.ll` (generated by `ludic-dev glgen` beside `gl_thunks.ll`) calls
every entry point through a table `@lgl_win_load` fills from `wglGetProcAddress`, falling