mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
renderer/opengl: small tweaks
This commit is contained in:
@ -2365,13 +2365,10 @@ fn drawCustomPrograms(self: *OpenGL, custom_state: *custom.State) !void {
|
||||
|
||||
// Go through each custom shader and draw it.
|
||||
for (custom_state.programs) |program| {
|
||||
// Bind our cell program state, buffers
|
||||
const bind = try program.bind();
|
||||
defer bind.unbind();
|
||||
try bind.draw();
|
||||
|
||||
// copy main and custom fbo
|
||||
try custom_state.copy();
|
||||
try custom_state.copyFramebuffer();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,12 +230,19 @@ pub const State = struct {
|
||||
};
|
||||
}
|
||||
|
||||
/// copy the fbo's attached texture to the backbuffer
|
||||
pub fn copy(self: *State) !void {
|
||||
/// Copy the fbo's attached texture to the backbuffer.
|
||||
pub fn copyFramebuffer(self: *State) !void {
|
||||
const texbind = try self.fb_texture.bind(.@"2D");
|
||||
errdefer texbind.unbind();
|
||||
|
||||
try texbind.copySubImage2D(0, 0, 0, 0, 0, @intFromFloat(self.uniforms.resolution[0]), @intFromFloat(self.uniforms.resolution[1]));
|
||||
try texbind.copySubImage2D(
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
@intFromFloat(self.uniforms.resolution[0]),
|
||||
@intFromFloat(self.uniforms.resolution[1]),
|
||||
);
|
||||
}
|
||||
|
||||
pub const Binding = struct {
|
||||
|
Reference in New Issue
Block a user