Add a format function to vector and matrix structs #1240
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#1240
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
It would be convenient to include a format function in Vec and Mat structs (and other similar types) for easy printing of these types (std.debug.print, allocPrint, etc).
Default for Vec2 is:
math.vec.Vec(2,f32){ .v = { 1e0, 2e0 } }
A more compact Vec2 output:
[1.0 2.1]
or
1.0, 2.1
or
1.0 2.1
Mat2x2:
1.0, 0.0], [0.0, 1.0
or
[1.0 0.0] [0.0, 1.0]
Or something along these lines.
https://ziglang.org/documentation/master/std/#std.fmt.Formatter