SDL3 has a new “GPU” API, which is some kind abstraction over Vulkan/DirectX12/Metal. I imagine it hides a bunch of boilerplate as well. With this, I think, one could do a 3D render engine without having to directly use the Vulkan API (or OpenGL, …). However, the shaders need to be in whatever format the backend expects it seems.
Don’t use
ls
if you want to get filenames, it does a bunch of stuff to them. Use a shell glob orfind
.Also, because filenames can have newlines, if you want to loop over them, it’s best to use one these:
for x in *; do do_stuff "$x"; done # can be any shell glob, not just * find . -exec do_stuff {} \; find . -print0 | xargs -0 do_stuff # not POSIX but widely supported find . -print0 | xargs -0 -n1 do_stuff # same, but for single arg command
When reading newline-delimited stuff with
while read
, you want to use:cat filenames.txt | while IFS= read -r x; do_stuff "$x"; done
The
IFS=
prevents trimming of whitespace, and-r
prevents interpretation of backslashes.