GUI: Box drawing

This commit is contained in:
2026-05-13 05:40:31 +02:00
parent 79c62141df
commit bce62feb09
24 changed files with 747 additions and 62 deletions

View File

@@ -771,24 +771,7 @@ pub fn deinit(self: *Skybox, engine: *Engine) void {
engine.destroyImage(self.image);
}
pub fn bind(self: *const Skybox, command_buffer: CommandBuffer, extent: vk.Extent2D) !void {
command_buffer.setViewport(0, &.{
.{
.x = 0,
.y = 0,
.width = @floatFromInt(extent.width),
.height = @floatFromInt(extent.height),
.min_depth = 0,
.max_depth = 1,
},
});
command_buffer.setScissor(0, &.{
.{
.offset = .{ .x = 0, .y = 0 },
.extent = extent,
},
});
command_buffer.bindPipeline(.graphics, self.pipeline);
pub fn draw(self: *const Skybox, command_buffer: CommandBuffer) !void {
try command_buffer.bindVertexBuffers(0, &.{
.{
.buffer = self.vertex_buffer.buffer,
@@ -796,9 +779,8 @@ pub fn bind(self: *const Skybox, command_buffer: CommandBuffer, extent: vk.Exten
},
});
command_buffer.bindIndexBuffer(self.index_buffer.buffer, 0, .uint16);
}
pub fn draw(self: *const Skybox, command_buffer: CommandBuffer) void {
command_buffer.bindPipeline(.graphics, self.pipeline);
command_buffer.bindDescriptorSet(.graphics, self.pipeline_layout, 0, self.descriptor_set, null);
command_buffer.drawIndexed(.{ .index_count = 36 });
}