diff --git a/src/old/App.zig b/src/old/App.zig deleted file mode 100644 index ea2d6d8d8..000000000 --- a/src/old/App.zig +++ /dev/null @@ -1,52 +0,0 @@ -//! App is the primary GUI application for ghostty. This builds the window, -//! sets up the renderer, etc. The primary run loop is started by calling -//! the "run" function. -const App = @This(); - -const std = @import("std"); -const Allocator = std.mem.Allocator; -const glfw = @import("glfw"); -const gl = @import("opengl.zig"); -const TextRenderer = @import("TextRenderer.zig"); -const Grid = @import("Grid.zig"); -const Window = @import("Window.zig"); - -const log = std.log; - -alloc: Allocator, - -window: glfw.Window, - -text: TextRenderer, -grid: Grid, - -/// Initialize the main app instance. This creates the main window, sets -/// up the renderer state, compiles the shaders, etc. This is the primary -/// "startup" logic. -pub fn init(alloc: Allocator) !App { - // Create the window - const window = try Window.create(alloc); - - return App{ - .window = window, - }; -} - -pub fn deinit(self: *App) void { - self.window.destroy(); - self.* = undefined; -} - -pub fn run(self: App) !void { - while (!self.window.shouldClose()) { - // Setup basic OpenGL settings - gl.clearColor(0.2, 0.3, 0.3, 1.0); - gl.clear(gl.c.GL_COLOR_BUFFER_BIT); - - try self.grid.render(); - //try self.text.render("sh $ /bin/bash -c \"echo hello\"", 25.0, 25.0, .{ 0.5, 0.8, 0.2 }); - - try self.window.swapBuffers(); - try glfw.waitEvents(); - } -} diff --git a/src/old/fonts.zig b/src/old/fonts.zig deleted file mode 100644 index bd951d7a8..000000000 --- a/src/old/fonts.zig +++ /dev/null @@ -1,39 +0,0 @@ -const std = @import("std"); -const fc = @cImport({ - @cInclude("fontconfig/fontconfig.h"); -}); - -// Set to true when FontConfig is initialized. -var initialized: bool = false; - -pub fn list() !void { - if (!initialized) { - if (fc.FcInit() != fc.FcTrue) { - return error.InitializionFailed; - } - } - - const pat = fc.FcPatternCreate(); - defer fc.FcPatternDestroy(pat); - - const key = fc.FC_FULLNAME; - const os = fc.FcObjectSetBuild( - key, - @as([*c]const u8, 0), // @as required Zig #1481 - ); - defer fc.FcObjectSetDestroy(os); - - const fs = fc.FcFontList(null, pat, os); - defer fc.FcFontSetDestroy(fs); - - var i: usize = 0; - while (i <= fs.*.nfont) : (i += 1) { - const fpat = fs.*.fonts[i]; - var str: [*c]fc.FcChar8 = undefined; - if (fc.FcPatternGetString(fpat, key, 0, &str) == fc.FcResultMatch) { - std.log.info("FONT: {s}", .{ - @ptrCast([*:0]u8, str), - }); - } - } -} diff --git a/src/old/stb.zig b/src/old/stb.zig deleted file mode 100644 index ad4459344..000000000 --- a/src/old/stb.zig +++ /dev/null @@ -1 +0,0 @@ -pub const c = @import("stb/c.zig"); diff --git a/src/old/stb/c.zig b/src/old/stb/c.zig deleted file mode 100644 index 26c88ca4e..000000000 --- a/src/old/stb/c.zig +++ /dev/null @@ -1,3 +0,0 @@ -pub usingnamespace @cImport({ - @cInclude("stb_image.h"); -}); diff --git a/src/old/stb/stb.c b/src/old/stb/stb.c deleted file mode 100644 index 917728838..000000000 --- a/src/old/stb/stb.c +++ /dev/null @@ -1,2 +0,0 @@ -#define STB_IMAGE_IMPLEMENTATION -#include