update to Zig 2024.10-mach (helps hexops/mach#1276)

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-10-04 13:45:45 -07:00 committed by Stephen Gutekanst
parent 55e6abda61
commit 26c5cb5d60
28 changed files with 192 additions and 203 deletions

View file

@ -62,7 +62,7 @@ fn init(
.mapped_at_creation = .false,
});
const bind_group_layout_entry = gpu.BindGroupLayout.Entry.buffer(0, .{ .vertex = true }, .uniform, true, 0);
const bind_group_layout_entry = gpu.BindGroupLayout.Entry.initBuffer(0, .{ .vertex = true }, .uniform, true, 0);
const bind_group_layout = device.createBindGroupLayout(
&gpu.BindGroupLayout.Descriptor.init(.{
.label = label,
@ -77,7 +77,7 @@ fn init(
&gpu.BindGroup.Descriptor.init(.{
.label = label,
.layout = bind_group_layout,
.entries = &.{gpu.BindGroup.Entry.buffer(0, uniform_buffer, uniform_offset * i, @sizeOf(UniformBufferObject), @sizeOf(UniformBufferObject))},
.entries = &.{gpu.BindGroup.Entry.initBuffer(0, uniform_buffer, uniform_offset * i, @sizeOf(UniformBufferObject), @sizeOf(UniformBufferObject))},
}),
);
}

View file

@ -20,7 +20,7 @@ spawn_timer: mach.time.Timer,
fps_timer: mach.time.Timer,
frame_count: usize,
sprites: usize,
rand: std.rand.DefaultPrng,
rand: std.Random.DefaultPrng,
time: f32,
pipeline: mach.EntityID,
frame_encoder: *gpu.CommandEncoder = undefined,
@ -94,7 +94,7 @@ fn init(
.fps_timer = try mach.time.Timer.start(),
.frame_count = 0,
.sprites = 0,
.rand = std.rand.DefaultPrng.init(1337),
.rand = std.Random.DefaultPrng.init(1337),
.time = 0,
.pipeline = pipeline,
});

View file

@ -1,6 +1,6 @@
const mach = @import("mach");
const gpu = mach.gpu;
const ft = @import("freetype");
const freetype = @import("freetype");
const std = @import("std");
const assets = @import("assets");
@ -20,8 +20,8 @@ var gpa = std.heap.GeneralPurposeAllocator(.{}){};
texture_atlas: mach.gfx.Atlas,
texture: *gpu.Texture,
ft: ft.Library,
face: ft.Face,
ft: freetype.Library,
face: freetype.Face,
regions: RegionMap = .{},
allocator: std.mem.Allocator,
@ -63,7 +63,7 @@ fn init(
.rgba,
);
const ft_lib = try ft.Library.init();
const ft_lib = try freetype.Library.init();
const face = try ft_lib.createFaceMemory(assets.roboto_medium_ttf, 0);
glyphs.init(.{

View file

@ -28,7 +28,7 @@ frame_count: usize,
frame_rate: usize,
num_sprites_spawned: usize,
score: usize,
rand: std.rand.DefaultPrng,
rand: std.Random.DefaultPrng,
time: f32,
allocator: std.mem.Allocator,
pipeline: mach.EntityID,
@ -148,7 +148,7 @@ fn init(
.frame_rate = 0,
.num_sprites_spawned = 0,
.score = 0,
.rand = std.rand.DefaultPrng.init(1337),
.rand = std.Random.DefaultPrng.init(1337),
.time = 0,
.allocator = allocator,
.pipeline = pipeline,

View file

@ -25,7 +25,7 @@ spawn_timer: mach.time.Timer,
fps_timer: mach.time.Timer,
frame_count: usize,
sprites: usize,
rand: std.rand.DefaultPrng,
rand: std.Random.DefaultPrng,
time: f32,
allocator: std.mem.Allocator,
pipeline: mach.EntityID,
@ -98,7 +98,7 @@ fn init(
.fps_timer = try mach.time.Timer.start(),
.frame_count = 0,
.sprites = 0,
.rand = std.rand.DefaultPrng.init(1337),
.rand = std.Random.DefaultPrng.init(1337),
.time = 0,
.allocator = allocator,
.pipeline = pipeline,

View file

@ -21,7 +21,7 @@ spawning: bool = false,
spawn_timer: mach.time.Timer,
fps_timer: mach.time.Timer,
frame_count: usize,
rand: std.rand.DefaultPrng,
rand: std.Random.DefaultPrng,
time: f32,
style1: mach.EntityID,
pipeline: mach.EntityID,
@ -109,7 +109,7 @@ fn init(
.player = player,
.fps_timer = try mach.time.Timer.start(),
.frame_count = 0,
.rand = std.rand.DefaultPrng.init(1337),
.rand = std.Random.DefaultPrng.init(1337),
.time = 0,
.style1 = style1,
.pipeline = pipeline,