This is anecdotal but I don't think I've run a high-end Windows game yet on Linux/Proton that didn't run better than it did on Windows. It's kind of silly.
I really wish JS had a simple and performant way to return multiple values from a function. All the workarounds are either wasteful or error-prone:
a) return wrapped inside new array or object: adds garbage collector pressure
b) assign to shared object and return that: messy, and gotta be careful what you do with the object after returning
c) use a generator function: much slower than a normal function.
@jonikorpi I would expect that extremely short-lived objects like this are okay-ish when it comes to garbage collection (typically it's "medium-lived" objects which are the main problem.
And with all the syntax sugar that JS/TS has added for destructuring, spreading, etc... I would think that parameter and return objects are extremely optimized.
And for "hot loop" functions I would try to restrict those to simple number args and return values, or move to WASM :)
@jonikorpi in the end there's still WASM as escape hatch to get rid of garbage collector unpredictability (have to do it right though and move large computation loops to WASM, and not cross the WASM/JS boundary too often)
Working on integrating sokol_imgui.h into the sokol-zig bindings (a bit tricky because I don't want to add a cimgui + Dear ImGui dependency to the sokol-zig bindings package, but the Zig build system is quite flexible and I found a quite clean way).
Not quite ready yet but I hope to wrap everything up tomorrow (including detailed readme updates)
Sample project is here (should already work, it currently pulls the sokol dependency from a branch that's not merged yet).
@litherum sometimes I have a feeling that the US is only one tiny step away from a Russian-style oligarchie, just instead of oil tycoons it would be Silicon Valley tycoons.
TL;DR: Too hard to learn; many people stick with OpenGL. In the meantime, a colleague at my university asked if it would be safe to basically switch to path tracing altogether for year 2 courses next year, using the APIs to render 2 tris essentially...
@dotstdy@jbikker it's not even the complexity of Vulkan, but the effort and lines of code required to get the same level of 'convenience' that Metal or D3D11 give out of the box. If Vulkan would be closer to Metal, sokol_gfx.h would have replaced the OpenGL backend years ago with a Vulkan backend. Same reason why the D3D11 backend hasn't been replaced with a D3D12 backend.
I'm not actually not sure yet why it doesn't start until clicked or tapped :D
It could be related to the WebAudio context not allowed to play until resumed, but I haven't seen yet that this "freezes" the entire app. At least this means that the audio and graphics are in sync.
I'll see if I can add a text message to "tap or click to start" or smth, then I'll prepare a PR.
@aras PS: the PR will come with a manually triggered "Deploy Web Page" GH Action which should make it easy to publish the web version under your own GH Pages URL (which should be "https://aras-p.github.io/demo-pd-cranktheworld/"
@aras very cool! builds and runs out of the box on Mac without even checking the readme for build instructions (e.g. just "cmake .. && cmake --build ." from within a build/ subdir)
C# question that doesn't seem particularly cursed, for once:
In MSBuild (a .csproj) I can tell a target to run at a certain time using BeforeTargets= and AfterTargets=. I know that there are certain built-in targets; one, the C# compilation step, is CoreCompile. I know this works, but I found out about it by rumor.
Where can I find documented, or how can I get msbuild/dotnet to tell me, the full list of "built-in" targets? I am esp interested in what target/step CopyToOutputDirectory occurs on
Another thing I noticed in the SDL 3 preview (which was apparently already added in vestigial form later in SDL 2) is that they have support now for a callback-based life cycle so you can integrate properly with platforms which expect that without having to resort to inversion-of-control hacks like fibers for interop. While I always liked the "app controls the main loop" aspect of the classic SDL event pumping model, that ship has sailed if you care about cross-platform support.
@pervognsen it's actually interesting how easy it was to integrate a basic "render during resize" in Windows in sokol_app.h without affecting user code (because sokol_app.h also has a frame callback model).
It's not perfect because rendering inside resizing throttled via WM_TIMER interacts badly with DXGIs vsync, e.g. you'll have to do this, otherwise the whole window system "stutters":
@raph@pervognsen ...for reference I'm using D3D11 with a DXGI_SWAP_EFFECT_FLIP_DISCARD swapchain, not sure how that differs from the "DX12 style flip model".
@pervognsen this is exactly one of the current downsides in sokol_app.h, there's a 1:1 relationship between the 'frame callback' and present. Currently this means that one cannot easily pause/freeze/skip rendering. It's somewhere fairly down the todo list :D
@raph@pervognsen I seem to remember that I also got a deprecation warning when using a BLIT swapchain... that's why I switched to FLIP_DISCARD in the first place, even if that meant more work (e.g. doing my own MSAA resolve)
Sooo how do we protect the web from AI-enshittification? A new search engine? Perhaps powered by human curation? Easier self-publishing via better social media? Something else?
@sinbad@jonikorpi ...also I keep thinking that Goebbels would be all over social media if he lived today. Back in the 30s the Nazis only had radio and were experimenting with television, but with social media you can deliver personalized propaganda, it's a direct wire into every user's brain and you even get direct feedback how responsive the user is and tweak the propaganda messages for maximum effect.
@sinbad@jonikorpi ...funny thought, but I think the Amish had those problems figured out a long time before anybody else and developed a working strategy against those modern "brain eating propaganda viruses" ;)
"The algorithm uses exactly the same terminology and is presented in bottom-up form. (If you prefer top-down design, please read the rest of this section backwards.)"
@lritter@TomF@pervognsen WASM also only has structured control flow, but to my surprise my hilarious CPU emulator switch-case-goto contraption performs quite well in WASM compared to native (trigger warning for "goto considered harmful" believers):