New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flecs identifiers #536
base: main
Are you sure you want to change the base?
Flecs identifiers #536
Conversation
… of identifiers and types
…v into flecs_identifiers
@Srekel Could you help review this? |
@robinheydon which verison of Zig are you using/targeting? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zflecs/src/tests.zig needs updating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use zig fmt .
in repo root
@@ -13,6 +13,7 @@ pub fn build(b: *std.Build) void { | |||
.target = target, | |||
.optimize = optimize, | |||
}); | |||
b.installArtifact(flecs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what's going on with the diff, but installArtifact(flecs)
is already being called on main branch, albeit not on this exact line. Can you try rebasing this branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, will do.
const ztracy = b.addModule("root", .{ | ||
.root_source_file = .{ .path = "src/ztracy.zig" }, | ||
.imports = &.{ | ||
.{ .name = "ztracy_options", .module = options_module }, | ||
}, | ||
}); | ||
ztracy.addIncludePath(.{ .path = "libs/tracy/tracy" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise here (changes present on main not showing in diff)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange... I'll have a look
Yeah I'll take a look after your initial concerns have been addressed :) |
This adds a number of flecs identifiers into zig-gamedev. This is done either by just adding the external symbol definition or by using
ecs_id
(which uses@extern
to reference the symbol created by the C macro used to create the symbol).This also changes the interface for flecs.init to take an allocator, and then use that allocator within flecs. This allows the use of tracy allocator or a logging allocator to watch what flecs is doing with memory.
Added
componentWithOptions
for defining a component with additional options, such as an explicit name / symbol rather than just relying on@typeName
. Also addedtagWithOptions
for defining a tag with additional options.Also added
setMonitor
into the zglfw Window struct.Also fixed ztracy allocator to the latest zig allocator interface.