diff options
Diffstat (limited to 'src/screen/drm/buffer/root.zig')
| -rw-r--r-- | src/screen/drm/buffer/root.zig | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/screen/drm/buffer/root.zig b/src/screen/drm/buffer/root.zig index e967d51..d40fd8d 100644 --- a/src/screen/drm/buffer/root.zig +++ b/src/screen/drm/buffer/root.zig @@ -7,17 +7,21 @@ pub const Buffer = struct { current: Raw, crtc: Raw, - pub fn init(card: *drm.Card, width: u32, height: u32, bpp: u32) !Self { + pub fn init(card: *drm.Card, width: u32, height: u32) !Self { return .{ - .current = try Raw.init(card, width, height, bpp), - .crtc = try Raw.init(card, width, height, bpp), + .current = try Raw.init(card, width, height), + .crtc = try Raw.init(card, width, height), }; } pub fn swap(self: *Self) void { - const data = self.current.data; - self.current.data = self.crtc.data; - self.crtc.data = data; + const pixels = self.current.pixels; + self.current.pixels = self.crtc.pixels; + self.crtc.pixels = pixels; + + const bytes = self.current.bytes; + self.current.bytes = self.crtc.bytes; + self.crtc.bytes = bytes; const id = self.current.id; self.current.id = self.crtc.id; |