Windows build

This commit is contained in:
2026-11-22 19:49:50 -03:00
parent ed6f5fe0df
commit cbd662dc2a
12 changed files with 625 additions and 16 deletions
+3 -4
View File
@@ -5,9 +5,9 @@
// client/native/web_audio.ts), each of its sources an openal source. openal mixes on a thread of its own, with hrtf
// like browsers' panners, and linear distance falloff the same as a web audio panner's
import type { AudioCommand, SourceSettings } from "../client/native/messages.ts";
import { type LibraryFiles, open_library } from "./libraries.ts";
const LIBRARY =
{ linux: "libopenal.so.1", windows: "OpenAL32.dll", darwin: "libopenal.1.dylib" }[Deno.build.os as string];
const LIBRARY: LibraryFiles = { linux: "libopenal.so.1", windows: "OpenAL32.dll", darwin: "libopenal.1.dylib" };
const SYMBOLS = {
alcOpenDevice: { parameters: ["pointer"], result: "pointer" },
@@ -77,8 +77,7 @@ export class OpenAl {
// throws when there's no openal or no sound device
constructor() {
if (!LIBRARY) throw new Error(`There's no openal for ${Deno.build.os}`);
this.#al = Deno.dlopen(LIBRARY, SYMBOLS).symbols;
this.#al = open_library("openal", LIBRARY, SYMBOLS);
const al = this.#al;
const device = al.alcOpenDevice(null);
if (!device) throw new Error("There's no sound device");