xcb: add Vulkan init to sample
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
const std = @import("std");
|
||||
const xcb = @import("xcb");
|
||||
|
||||
pub fn main(init: std.process.Init) !void {
|
||||
_ = init;
|
||||
const Vulkan = @import("Vulkan.zig");
|
||||
|
||||
// Declarations picked up by "vulkan" module
|
||||
|
||||
pub const xcb_connection_t = xcb.Connection;
|
||||
pub const xcb_visualid_t = xcb.Visualid;
|
||||
pub const xcb_window_t = xcb.Window;
|
||||
|
||||
pub fn main(init: std.process.Init) !void {
|
||||
const connection = xcb.Connection.connect(null, null);
|
||||
defer connection.disconnect();
|
||||
|
||||
@@ -64,6 +70,9 @@ pub fn main(init: std.process.Init) !void {
|
||||
_ = connection.mapWindow(window);
|
||||
_ = connection.flush();
|
||||
|
||||
var vulkan = try Vulkan.init(init.gpa, connection, window);
|
||||
defer vulkan.deinit(init.gpa);
|
||||
|
||||
var running = true;
|
||||
while (running) {
|
||||
if (connection.waitForEvent()) |event| {
|
||||
|
||||
Reference in New Issue
Block a user