Change World.enableRest to only take port

main
copygirl 9 months ago
parent b170082b51
commit 12280219cb
  1. 6
      src/world.zig

@ -49,8 +49,8 @@ pub fn World(comptime ctx: anytype) type {
flecszigble.allocator.destroy(self);
}
pub fn enableRest(self: *Self, options: struct { port: u16 = 0, addr: ?[:0]const u8 = null }) !void {
try self.set(flecs.rest.Rest, .{ .port = options.port, .ipaddr = @constCast(options.addr) });
pub fn enableRest(self: *Self, port: u16) !void {
try self.set(flecs.rest.Rest, .{ .port = port });
}
pub fn progress(self: *Self, delta_time: f32) bool {
@ -297,7 +297,7 @@ test "World REST API" {
flecszigble.init(alloc);
var world = try World(void).init();
defer world.deinit();
try world.enableRest(.{ .port = 42666 });
try world.enableRest(42666);
const Runner = struct {
pub fn run(w: *World(void)) void {

Loading…
Cancel
Save