summaryrefslogtreecommitdiff
path: root/pkg/opengl/Framebuffer.zig
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/opengl/Framebuffer.zig')
-rw-r--r--pkg/opengl/Framebuffer.zig24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkg/opengl/Framebuffer.zig b/pkg/opengl/Framebuffer.zig
index c5d659f98..ea1f0d2ba 100644
--- a/pkg/opengl/Framebuffer.zig
+++ b/pkg/opengl/Framebuffer.zig
@@ -5,6 +5,7 @@ const c = @import("c.zig").c;
const errors = @import("errors.zig");
const glad = @import("glad.zig");
const Texture = @import("Texture.zig");
+const Renderbuffer = @import("Renderbuffer.zig");
id: c.GLuint,
@@ -86,6 +87,29 @@ pub const Binding = struct {
try errors.getError();
}
+ pub fn renderbuffer(
+ self: Binding,
+ attachment: Attachment,
+ buffer: Renderbuffer,
+ ) !void {
+ glad.context.FramebufferRenderbuffer.?(
+ @intFromEnum(self.target),
+ @intFromEnum(attachment),
+ c.GL_RENDERBUFFER,
+ buffer.id,
+ );
+ try errors.getError();
+ }
+
+ pub fn drawBuffers(
+ self: Binding,
+ bufs: []Attachment,
+ ) !void {
+ _ = self;
+ glad.context.DrawBuffers.?(@intCast(bufs.len), bufs.ptr);
+ try errors.getError();
+ }
+
pub fn checkStatus(self: Binding) Status {
return @enumFromInt(glad.context.CheckFramebufferStatus.?(@intFromEnum(self.target)));
}