Files
ghostty/src/renderer/backend.zig
Mitchell Hashimoto 800fa99ff2 build: move apprt, font, renderer enums to dedicated files
This reduces the surface area of files we depend on for builds.
2025-09-19 15:17:41 -07:00

24 lines
534 B
Zig

const std = @import("std");
const WasmTarget = @import("../os/wasm/target.zig").Target;
/// Possible implementations, used for build options.
pub const Backend = enum {
opengl,
metal,
webgl,
pub fn default(
target: std.Target,
wasm_target: WasmTarget,
) Backend {
if (target.cpu.arch == .wasm32) {
return switch (wasm_target) {
.browser => .webgl,
};
}
if (target.os.tag.isDarwin()) return .metal;
return .opengl;
}
};