fix(window): the title a program passes to gl_open / gvk_open reaches the window

The runtime opens a game's window before main, titled with the program's name, and
gl_open attached to it without passing its title on (render3d's gvk_open called win_open,
which returns early on Windows and opened a second window on macOS). win_set_title in
cocoa.ll / win32.ll (setTitle: / SetWindowTextW, UTF-8 -> UTF-16; a no-op without a window,
stubbed headless) retitles it from gl_open, and win_open on an open window retitles it on
both platforms.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-17 14:02:23 +03:00
parent bb267ff3d5
commit 1256bbfec7
7 changed files with 93 additions and 3 deletions

View file

@ -378,6 +378,12 @@ entry:
}
; the drawable's size, for a graphics API that follows the window without a GL context (render3d's
; Vulkan resize check); headless there is no window, so 0 x 0. cocoa.ll's real one wins when linked.
; win_set_title: cocoa.ll's in a windowed build; nothing to retitle headless
define weak void @win_set_title(ptr %title) {
entry:
ret void
}
define weak void @win_gl_drawable(ptr %out) {
entry:
store i32 0, ptr %out