Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- `docs/path-finding-grids.md` - Pixely.PathFinding.Grids: grid geometry, clearance-based agent footprints, connectivity and the corner rule, overlays, the admissible grid heuristic
- `docs/development-packages.md` - Consuming packages from the public development feed
- `docs/sdk.md` - Pixely as an MSBuild project SDK: the `<Sdk Name="Pixely" />` line, what it adds to a project, the browser build and its framework switch, central package management, the PIXELY0002 error for projects without it, the package layout with its two `lib/` folders
- `docs/hosting.md` - Hosting: opting in with `PixelyHosting`, the generated `Main`, `Configure` and `OnException` with its default message box in Release builds, diagnostics, the browser: `dotnet publish -r browser-wasm`, the `net11.0-browser` framework switch and its lateness, multi-targeting with `-f net11.0-browser`, `BrowserHost` and the frame loop, exit codes, the default page and its replacement, Mono AOT on by default (`RunAOTCompilation`), its opt-out and what IL stripping leaves readable, opt-in Brotli downloads with `PixelyBrowserBrotli` through the boot config for hosts without `Content-Encoding: br` such as GitHub Pages, XDL linked into the browser runtime from `XdlSharp.Native.browser-wasm` with the workload and `WasmBuildNative`, the formats XDL's satellites decode, native archives from a URL with `NativeUrlReference`, WebGPU in the browser: device adoption through `BrowserHost.PrepareAsync`, the fallback adapter warning, notice, `pixelygpuadapter` event and `readGpuAdapter()`, device loss and `GpuDeviceLostException`, the default page's loading indicator and stop message, the `pixelyfirstframe` event, teardown, what is unsupported
- `docs/hosting.md` - Hosting: opting in with `PixelyHosting`, the generated `Main`, `Configure` and `OnException` with its default message box in Release builds, diagnostics, the browser: `dotnet publish -r browser-wasm`, the `net11.0-browser` framework switch and its lateness, multi-targeting with `-f net11.0-browser`, `BrowserHost` and the frame loop, exit codes, the default page and its replacement, Mono AOT on by default (`RunAOTCompilation`), its opt-out and what IL stripping leaves readable, opt-in Brotli downloads with `PixelyBrowserBrotli` through the boot config for hosts without `Content-Encoding: br` such as GitHub Pages, an installable app with `PixelyBrowserInstallable`, the generated web app manifest, its icons and PIXELY0016, XDL linked into the browser runtime from `XdlSharp.Native.browser-wasm` with the workload and `WasmBuildNative`, the formats XDL's satellites decode, native archives from a URL with `NativeUrlReference`, WebGPU in the browser: device adoption through `BrowserHost.PrepareAsync`, the fallback adapter warning, notice, `pixelygpuadapter` event and `readGpuAdapter()`, device loss and `GpuDeviceLostException`, the default page's loading indicator and stop message, the `pixelyfirstframe` event, teardown, what is unsupported
- `docs/cursors.md` - Mouse cursors through `ICursorService`: system, image and animated cursors, the hotspot, frame durations, setting, resetting and hiding the cursor, cursor lifetime and the main-thread rule, platform behavior of animated cursors, headless mode
- `docs/platform-settings.md` - The user's OS or browser settings through `IPlatformSettings`: the main-thread rule, the light or dark theme with `ThemeChanged`, where SDL reads it on each platform, `Unknown` without an XDG portal and in headless mode; preferred locales with `Locale` for games that set `InvariantGlobalization`, why `CultureInfo` cannot tell them there, unvalidated codes, Linux ordering, the 127-byte limit, the `SDL_HINT_PREFERRED_LOCALES` override and its environment variable, skipped empty items, `PreferredLocalesChanged` and the platforms where SDL reports changes
- `docs/taskbar-icons.md` - Application-wide taskbar and Dock icons loaded from virtual content
Expand Down
9 changes: 9 additions & 0 deletions DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

Design decisions with the constraints that decided them and their known costs, newest first.

## 2026-11-19: An installable browser app gets a generated manifest and no service worker

`PixelyBrowserInstallable` generates a web app manifest (`docs/hosting.md`). A publish has no service worker, so an installed game still needs the network to start.

- Chrome installs an app from its menu without a worker.
- WriteLinesToFile turns backslashes into slashes on Unix, and a quote in a path ends a property function's argument, so an inline task resolves the icons and writes the manifest and the page.

Cost: the inline task compiles with Roslyn on its first use in a build.

## 2026-11-14: A test app never starts SDL, so tests run in parallel

`TestApp.CreateBuilder()` builds an app without SDL (`docs/testing.md`). Its windows are `StubWindow`s without a platform, its display, cursors, clipboard and platform settings are stubs, its text uses `StubFontSystem`, and its sound `StubAudioSystem`. `Window` became platform-neutral, and `NativeWindow` holds the SDL window under `SwapchainWindow` and `OffscreenWindow`. `AudioSystem` became an abstract base with internal `*Core` methods, as `GpuDevice` is, with `SdlAudioSystem` on SDL_mixer. `PixelyAppBuilder.Build()`, `AddGpuServices` and `RegisterAudio` register a default only when nothing has registered the service, and a frame reads the platform through an internal `IEventSource`.
Expand Down
36 changes: 36 additions & 0 deletions docs/hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,3 +439,39 @@ content.

Leave the property off on a host that sends `Content-Encoding: br` itself. The download is the same
size, and Chrome compiles `dotnet.native.wasm` while it downloads instead of decoding it afterwards.

### Installable app

`PixelyBrowserInstallable=true` makes the published page a web app that a browser can install, as a
window of its own and an entry in the launcher or on the home screen:

```xml
<PropertyGroup>
<PixelyBrowserInstallable>true</PixelyBrowserInstallable>
<PixelyBrowserAppName>Example Game</PixelyBrowserAppName>
<PixelyBrowserThemeColor>#1a1a2e</PixelyBrowserThemeColor>
</PropertyGroup>
<ItemGroup>
<PixelyBrowserAppIcon Include="Branding\icon-192.png" Sizes="192x192" />
<PixelyBrowserAppIcon Include="Branding\icon-512.png" Sizes="512x512" Purpose="any maskable" />
</ItemGroup>
```

- The SDK generates `manifest.webmanifest` with the name, `"start_url": "./"`,
`"display": "standalone"`, the colour as both theme and background colour, and the icons.
`PixelyBrowserAppName` defaults to `$(Product)`, which defaults to the assembly name.
`PixelyBrowserThemeColor` defaults to `#000`, the default page's background.
- An icon under the project's `wwwroot/` is served from there already, and the manifest names it by
its path there. Any other icon is served at its `TargetPath`, by default its file name. `Sizes`
is the manifest's space-separated `sizes`, and `Purpose`, when set, its `purpose`.
- Chrome installs an app only with a 192x192 and a 512x512 icon, so without both the build fails
with PIXELY0016.
- The package's `index.html` gets `<link rel="manifest" href="manifest.webmanifest" />` and
`<meta name="theme-color">` before `</head>`. A project's own `wwwroot/index.html` or a page named
by `PixelyBrowserIndexHtml` adds both itself.
- A project's own `wwwroot/manifest.webmanifest` replaces the generated one. Its icons are still
served, and the icon check is then the project's own. `PixelyBrowserDefaultAssets=false` turns off the generated manifest, the
served icons and the tags with the rest of the page, since Pixely then adds no web asset.

A browser installs only a page from a secure context, which WebGPU needs anyway. An installed app
still needs the network to start.
2 changes: 1 addition & 1 deletion docs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Sdk/Sdk.props, Sdk/Sdk.targets imported by the SDK resolver
Sdk/Pixely.AfterSdk.targets WebAssembly, shader and hosting targets, imported once the base SDK has set its properties
Sdk/Pixely.Hosting.targets the entry point generator
Sdk/Pixely.Browser.props imports the WebAssembly SDK props on browser-wasm
Sdk/Pixely.Browser.targets the framework switch, browser property overrides, XDL's link settings, native URL references, PIXELY0004 to PIXELY0012, the default web assets, the Brotli boot config extension, the browser file system
Sdk/Pixely.Browser.targets the framework switch, browser property overrides, XDL's link settings, native URL references, PIXELY0004 to PIXELY0012 and PIXELY0016, the default web assets, the web app manifest, the Brotli boot config extension, the browser file system
Sdk/Pixely.Native.targets the XdlSharp.Native.<rid> reference, PIXELY0014 and PIXELY0015
Sdk/Pixely.Version.props the package version and the XdlSharp version, generated at pack time
buildTransitive/Pixely.targets fails a project that reaches Pixely without the SDK
Expand Down
Loading