libmach: update the C API - expose init, update, and deinit functions #420
No reviewers
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach!420
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "libmach"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request reworks the libmach C API.
Instead of working with callbacks,
libmachexposes functions such asmach_init_core,mach_update, andmach_deinitto be called by users of the shared libraryExamples using this new API can be found in the
libmach/directory.By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
@ -35,0 +82,4 @@core.delta_time_ns = core.timer.lapPrecise();core.delta_time = @intToFloat(f32, core.delta_time_ns) / @intToFloat(f32, std.time.ns_per_s);I think to increase the odds that
libmachis always up-to-date and working, and to get higher odds of it also working on other platforms (webassembly for example), we should instead havenative.zigexport an API whichlibmach.zigcalls into. Thenlibmach.zigbecomes just rather simple C export wrappers.@iddev5 do you agree with that?
A clear improvement over what we have right now, so merging!
@ -35,0 +82,4 @@core.delta_time_ns = core.timer.lapPrecise();core.delta_time = @intToFloat(f32, core.delta_time_ns) / @intToFloat(f32, std.time.ns_per_s);Yes, this was the idea all along. Plus these functions will be able to reduce the code duplication which we have with mach_update and things like that.
Good PR. I didnt got time to review it but one minor thing I would say is that namings are odd and inconsistent. I think we should just follow the
mach_<module>_<function>convention. So that makesmach_init_coreasmach_core_init. Just a thought.