Skip to content

Commit

Permalink
Bind wlr_drm_create()
Browse files Browse the repository at this point in the history
  • Loading branch information
ifreund committed Jan 7, 2024
1 parent 68ce607 commit aae7f23
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/types/drm.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const wlr = @import("../wlroots.zig");

const wayland = @import("wayland");
const wl = wayland.server.wl;

pub const Drm = extern struct {
global: *wl.Global,

events: extern struct {
destroy: wl.Signal(void),
},

// private state

node_name: [*:0]u8,
formats: wlr.DrmFormatSet,

server_destroy: wl.Listener(*wl.Server),

extern fn wlr_drm_create(server: *wl.Server, renderer: *wlr.Renderer) ?*Drm;
pub fn create(server: *wl.Server, renderer: *wlr.Renderer) !*Drm {
return wlr_drm_create(server, renderer) orelse error.WlrDrmCreateFailed;
}
};
2 changes: 2 additions & 0 deletions src/wlroots.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ pub const Swapchain = opaque {};
pub const DrmFormat = @import("render/drm_format_set.zig").DrmFormat;
pub const DrmFormatSet = @import("render/drm_format_set.zig").DrmFormatSet;

pub const Drm = @import("types/drm.zig").Drm;

pub const FractionalScaleManagerV1 = @import("types/fractional_scale_v1.zig").FractionalScaleManagerV1;

pub const ShmAttributes = @import("types/buffer.zig").ShmAttributes;
Expand Down

0 comments on commit aae7f23

Please sign in to comment.