mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
less dumb
This commit is contained in:
@ -67,7 +67,7 @@ pub fn run(self: App) !void {
|
||||
gl.clearColor(0.2, 0.3, 0.3, 1.0);
|
||||
gl.clear(gl.c.GL_COLOR_BUFFER_BIT);
|
||||
|
||||
try self.text.render("hello", 25.0, 25.0, 1.0, .{ 0.5, 0.8, 0.2 });
|
||||
try self.text.render("sh $ /bin/bash -c \"echo hello\"", 25.0, 25.0, 1.0, .{ 0.5, 0.8, 0.2 });
|
||||
|
||||
try self.window.swapBuffers();
|
||||
try glfw.waitEvents();
|
||||
|
@ -53,17 +53,6 @@ pub fn init(alloc: std.mem.Allocator) !TextRenderer {
|
||||
return error.GlyphLoadFailed;
|
||||
}
|
||||
|
||||
if (face.*.glyph.*.bitmap.buffer == null) {
|
||||
// Unrenderable characters
|
||||
chars.appendAssumeCapacity(.{
|
||||
.tex = undefined,
|
||||
.size = undefined,
|
||||
.bearing = undefined,
|
||||
.advance = undefined,
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
// Generate the texture
|
||||
const tex = try gl.Texture.create();
|
||||
var binding = try tex.bind(gl.c.GL_TEXTURE_2D);
|
||||
@ -177,7 +166,7 @@ pub fn render(
|
||||
const char = self.chars.items[c];
|
||||
|
||||
const xpos = curx + (char.bearing[0] * scale);
|
||||
const ypos = y + (char.bearing[1] * scale);
|
||||
const ypos = y - ((char.size[1] - char.bearing[1]) * scale);
|
||||
const w = char.size[0] * scale;
|
||||
const h = char.size[1] * scale;
|
||||
|
||||
|
@ -38,7 +38,7 @@ pub const Binding = struct {
|
||||
border: c.GLint,
|
||||
format: c.GLenum,
|
||||
typ: c.GLenum,
|
||||
data: *const anyopaque,
|
||||
data: ?*const anyopaque,
|
||||
) !void {
|
||||
c.glTexImage2D(
|
||||
b.target,
|
||||
|
Reference in New Issue
Block a user