const drm = @import("../root.zig"); pub const Buffer = struct { const Self = @This(); pub const Raw = @import("raw.zig").Raw; current: Raw, crtc: Raw, pub fn init(card: *drm.Card, width: u32, height: u32, bpp: u32) !Self { return .{ .current = try Raw.init(card, width, height, bpp), .crtc = try Raw.init(card, width, height, bpp), }; } pub fn swap(self: *Self) void { const data = self.current.data; self.current.data = self.crtc.data; self.crtc.data = data; const id = self.current.id; self.current.id = self.crtc.id; self.crtc.id = id; } pub fn deinit(self: *Self) void { self.current.deinit(); self.crtc.deinit(); } };