mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-06-02 05:28:46 +03:00
35 lines
1.3 KiB
Zig
35 lines
1.3 KiB
Zig
//! Renderer implementation and utilities. The renderer is responsible for
|
|
//! taking the internal screen state and turning into some output format,
|
|
//! usually for a screen.
|
|
//!
|
|
//! The renderer is closely tied to the windowing system which usually
|
|
//! has to prepare the window for the given renderer using system-specific
|
|
//! APIs. The renderers in this package assume that the renderer is already
|
|
//! setup (OpenGL has a context, Vulkan has a surface, etc.)
|
|
|
|
const builtin = @import("builtin");
|
|
|
|
pub usingnamespace @import("renderer/cursor.zig");
|
|
pub usingnamespace @import("renderer/message.zig");
|
|
pub usingnamespace @import("renderer/size.zig");
|
|
pub const Metal = @import("renderer/Metal.zig");
|
|
pub const OpenGL = @import("renderer/OpenGL.zig");
|
|
pub const WebGL = @import("renderer/WebGL.zig");
|
|
pub const Options = @import("renderer/Options.zig");
|
|
pub const Thread = @import("renderer/Thread.zig");
|
|
pub const State = @import("renderer/State.zig");
|
|
|
|
/// The implementation to use for the renderer. This is comptime chosen
|
|
/// so that every build has exactly one renderer implementation.
|
|
const wasm = @import("os/wasm.zig");
|
|
pub const Renderer = if (wasm.target) |target| switch (target) {
|
|
.browser => WebGL,
|
|
} else switch (builtin.os.tag) {
|
|
.macos => Metal,
|
|
else => OpenGL,
|
|
};
|
|
|
|
test {
|
|
@import("std").testing.refAllDecls(@This());
|
|
}
|