saving
This commit is contained in:
parent
6387fdaf16
commit
9d3190f78d
|
|
@ -1,6 +1,7 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
pub const core = @import("core");
|
pub const core = @import("core");
|
||||||
pub const cimgui = @import("cimgui");
|
pub const cimgui = @import("cimgui");
|
||||||
|
const rend = @import("rend");
|
||||||
|
|
||||||
pub const Module: core.ModuleDescription = .{
|
pub const Module: core.ModuleDescription = .{
|
||||||
.name = "imgui",
|
.name = "imgui",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
pub const ImguiImpl = struct {
|
||||||
|
allocator: std.mem.Allocator,
|
||||||
|
device: *gpu.GPUDevice,
|
||||||
|
|
||||||
|
// renderer plugin
|
||||||
|
pub fn create(device: *gpu.GPUDevice, allocator: std.mem.Allocator, settings: struct {}) !*@This() {
|
||||||
|
const self = try allocator.create(@This());
|
||||||
|
|
||||||
|
self.* = .{
|
||||||
|
.allocator = allocator,
|
||||||
|
.device = device,
|
||||||
|
};
|
||||||
|
_ = settings;
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn preTick(_: *@This(), _: f64) core.EngineDataEventError!void {
|
||||||
|
c.ImGui_ImplGlfw_NewFrame();
|
||||||
|
c.cImGui_vk_NewFrame();
|
||||||
|
c.igNewFrame();
|
||||||
|
}
|
||||||
|
|
||||||
|
// renderer plugin
|
||||||
|
pub fn destroy(p: *anyopaque) void {
|
||||||
|
const self: *@This() = @ptrCast(@alignCast(p));
|
||||||
|
|
||||||
|
self.allocator.destroy(self);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const c = @import("cimgui").c;
|
||||||
|
const ig = @import("cimgui").cimgui;
|
||||||
|
const sdl3 = @import("sdl3");
|
||||||
|
const gpu = sdl3.gpu;
|
||||||
|
const rend = @import("rend");
|
||||||
|
const std = @import("std");
|
||||||
|
const core = @import("core");
|
||||||
Loading…
Reference in New Issue