News for hackers. Stuff that matters.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @09:17AM (#44200563)
Last night I tried for maybe about 6 hours so many combinations of efforts to compile a C++, SDL3 and Lua program on Windows, with different IDEs, build systems, compilers, package managers etc. Finally I'm just giving up and using VS with CMake and vcpkg. The main problem is that there's way too many words on all those documentation pages. It would have taken 3 or 4 days to read them all, and maybe only 2 hours worth of it would have been helpful or relevant at all.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by dustbunny on Friday June 06, 2025 @10:35AM (#44201368)
I agree. I used chatgpt to write a makefile to compile sokol+Tracy. It's a pretty solid, generic makefile. But "build system complexity" pushed me away from sdl, magnum graphics and bgfx into the arms of sokol.

And I'm a 10+ year gamedev.

Out of all of c++'s sins, the lack of a solid integrated build system is the one that bites me the most.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @10:40AM (#44201407)
My theory is that good C++ devs haven't yet made a simple yet powerful build system because they're too busy making lots and lots of money writing enterprise C++.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by dazzawazza on Friday June 06, 2025 @11:00AM (#44201599)
We all just accepted CMake. It's not perfect but it works. C++ with SDL and Lua in a mono repo should be trivial. SDL3 supports CMake and Lua is simple to compile and make a CMakeLists.txt for.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by verall on Friday June 06, 2025 @11:56AM (#44202128)
This is correct. It has the key things that most C++ devs tend to care about:

- Cross platform support well integrating into "native" tooling

- Endless ability to add weird hacks to things to get around problems

The syntax is ...passable. I've never gotten a java stacktrace during a build failure (ahem bazel ahem).

It's straightforward enough to do the horrible things that C++ devs do all of the time like having 3 dependencies from system apt, 2 vendored, actually a 3rd is vendored but only used on windows, where the other 2 come from vcpkg, and 4 of these are statically linked but the last (openssl) is dynamic and accepts any version in order to support both ubuntu LTS and arch, but shipped as a dll on windows.

I have prayed before the CMake gods and they have accepted me.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by shortrounddev2 on Friday June 06, 2025 @01:22PM (#44203047)
Visual Studio + MSBuild is simple if you're okay with IDEs
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by dieortin on Friday June 06, 2025 @03:21PM (#44204086)
I really recommend Bazel (https://bazel.build)
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by pusewicz on Friday June 06, 2025 @05:29PM (#44205171)
What us better about it?
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by dieortin on Friday June 06, 2025 @05:56PM (#44205403)
Quite a few things. For a C++ only project, the biggest ones would be reproducibility and speed. But beyond those, I find it saner overall: the language is way easier to understand (~python), and the model of packages, targets, visibility etc makes it easy to organize and manage a large codebase.

The worst part about Bazel for C++ is that it’s not yet as widespread as CMake or plain old Makefiles so it can be harder to get third party libraries into your project, but that’s changing quite fast with the bazel registry, and you have things like rules_cc that help you run other build systems inside bazel.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by rudedogg on Friday June 06, 2025 @11:43AM (#44201982)
If you’re interested in Zig check out https://github.com/castholm/SDL.

Try the breakout example, I play around with it a lot. You’ll just need the Zig 0.14 compiler and it should be painless.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @12:02PM (#44202201)
Something about me has always wanted to learn and master C++. I've read through Stroustrup's book almost entirely, and still never written a single line of C++. I don't know why I have this goal in life, but I do. This project still doesn't do that, since I'm just wrapping SDL3 with QuickJS and will probably almost entirely just write C functions to do it with. But a man can dream.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by syspec on Friday June 06, 2025 @11:46AM (#44202014)
What's the relation of your comment to this blog post?
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @12:00PM (#44202177)
Mainly it just reminded me of what happened last night and seemed like good timing because of the similarity, but also I appreciate blog posts that are short and get right to the point of how to do something.

Half of the problems I got past were thanks to odd blog posts like this with code snippets that I found on google and got me unstuck immediately.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by syspec on Friday June 06, 2025 @08:21PM (#44206357)
Fair enough
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by raincole on Friday June 06, 2025 @09:51AM (#44200917)
I wonder if there is a SDL3 wrapper that comes with a scripting language[0], hot reload and build scripts for every major platform.

Love2D seems close to that, but afaik it doesn't support SDL3 features like the new GPU API.

[0]: It's not like I'm allergic to C++, but I firmly believe when developing something that is mostly interactive, such as complex GUI or games, a language that is garbage collected and can be hot reloaded would be much more apt.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @10:33AM (#44201347)
That's what I'm working on, basically love2d but SDL3 and TS/JS (via QuickJS). And no box2d builtin, but easily importable via CDN.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by raincole on Friday June 06, 2025 @11:13AM (#44201717)
That's my idea stack as well (I tried to build something like SDL2 + V8 at some point but ended up giving up...) If you have a repo/website set up please leave a link for me to follow :)
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @11:15AM (#44201732)
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @10:55AM (#44201551)
... at least if I can get the simplest Visual Studio + CMake + vcpkg hello world working.

Which I can't.

This always happens every few years. It takes me about a week to get a C++ program compiling and running, and by the end of it, I've lost all motivation, forget how any of it works, and delete it all and move back to TypeScript/web stuff. At least that I know despite all its warts.

[edit] figured it out

Hello me from the future, googling this in a few years. It's actually really simple: just follow the same steps on that page you were on[1] except you HAVE TO run the `vcpkg new --application` and `vcpkg add port fmt` commands in the dev cmd prompt, you can't just add the file manually for some reason, even though that's all it seems like it's doing.

[1] https://learn.microsoft.com/en-us/vcpkg/get_started/get-star...

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @07:00PM (#44205899)
I can't do it.

I can't work in Visual Studio. It's so unintuitive.

I have to do this in VS Code.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by CJefferson on Friday June 06, 2025 @01:54PM (#44203360)
Obviously you can do what you like, but I'd advise making sure box2d (or similar) is super easy. Bonus points if there is also a built in function for drawing box2d objects.

I've often taught beginning game dev in a day, and with box2d in love2d you can very quickly make a wide selection of cool games, and while it's not perfect it makes it easy to get started making platforms, doing collisions, all sorts of things.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @03:13PM (#44204028)
Fair enough, maybe I'll include it after all. Unless I get hung up on the question of which physics engine to include. Endless possibilities make decisions difficult.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by CJefferson on Saturday June 07, 2025 @06:05PM (#44213004)
A good way to think about it is in my opinion, you making a choice saves all your future users having to make that choice — imagine the decision making time they will all save.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by pusewicz on Friday June 06, 2025 @09:54AM (#44200960)
Try https://dragonruby.org/. It's great! Still on SDL2, but will migrate to SDL3 eventually.

Code reload (because it uses MRuby) is just :chef-kiss:

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by raincole on Friday June 06, 2025 @09:56AM (#44200979)
It looks like Love2D, except you pay $50 to use Ruby instead of Lua (admittedly I think Ruby is a better language.)

I haven't used DragonRuby though, so if my above snarky comment is off please point me out.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by pusewicz on Friday June 06, 2025 @09:59AM (#44201004)
Very often you can snatch free copies. Join the Discord. Just ask :)
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @10:34AM (#44201356)
As someone who dreams of making a living selling software that I've poured years and years into, that comment makes me very sad.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by pusewicz on Friday June 06, 2025 @01:12PM (#44202950)
But why?
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @01:36PM (#44203205)
Why do I want to make money from my hard work? Or why am I sad when someone offers a way to bypass paying money for hard work to get something for free?
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by fatihpense on Friday June 06, 2025 @05:36PM (#44205224)
I assumed the original developers might give free copies in the official discord
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by pusewicz on Friday June 06, 2025 @05:58PM (#44205421)
This.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by pusewicz on Friday June 06, 2025 @05:58PM (#44205417)
I meant that the author of DragonRuby is generous. And depending on your use case he might be willing to give you a free copy. Additionally, whenever there is a gamejam related to DragonRuby, he usually gives away free copies to anyone who wants to participate. For you to keep. Nobody said anything about bypassing paying money. Not sure what you were thinking.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Friday June 06, 2025 @06:56PM (#44205875)
To be honest I was just not giving the benefit of the doubt to the comment I was replying to. I should practice that.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by python-b5 on Friday June 06, 2025 @04:19PM (#44204589)
DragonRuby seems interesting, but being a paid product immediately rules it out for me. I've been working on my own similar, smaller framework, which is more work, but I believe it's valuable not to depend on a for-profit company for your work, if at all possible.

Also, the attitude much of the wiki / promotional pages are written in for that framework runs me the wrong way for some reason. "Unity and GameMaker rot your brain"... are you kidding me? No they don't. You're still writing real code and solving real problems. They just have more systems in place you have to work within. I don't like the self-righteous attitude. It's fair to not want to go open source if that's your preference, but don't act like people who don't want to use closed-source software where possible are being unreasonable. I also don't see how what is effectively a Ruby wrapper for SDL3 is such an immensely complicated piece of engineering that it needs to cost as much as they're charging for it.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by pusewicz on Friday June 06, 2025 @05:32PM (#44205190)
It’s not just a wrapper. There’s more to it than you might think. It’s easy to say „just” without spending time understanding what a tool does.
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by krapp on Friday June 06, 2025 @11:01AM (#44201609)
You can build a project linking SDL3 with Lua and have access to all of the features of SDL3, with the obvious caveat that you'll have to code the rest of the owl yourself, but it isn't difficult. I have a basic CMake script that I use for projects and it works fine. (also, obviously you can just run the Lua code locally and skip the build process altogether when developing.) I use LuaJIT though, and the FFI generator here[0].

[0]https://github.com/sonoro1234/LuaJIT-SDL3

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by whateveracct on Friday June 06, 2025 @09:07PM (#44206559)
yeah, software development on Windows is just terrible.

I do gamedev on Linux for this reason. With Nix it isn't even that bad to cross-compile.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by pjmlp on Saturday June 07, 2025 @02:03AM (#44207733)
- VS full install

- vcpgkg manifest file

- done

The problem is people pretending Windows is UNIX.

And UNIX community got lucky Apple decided to go with NeXTSTEP and not BeOS, otherwise those shiny fruit laptops would also be their own thing.

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Saturday June 07, 2025 @08:53AM (#44209329)
Then how would you install quickjs? conan? download and copy the files manually?
Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by pjmlp on Saturday June 07, 2025 @11:17AM (#44210229)
Why bother with conan, when vcpkg is already available and zero Python dependencies?

As for quickjs, it wasn't part of the comment, rather SDL3 and Lua.

> ...combinations of efforts to compile a C++, SDL3 and Lua program on Windows...

As such,

https://vcpkg.io/en/package/sdl3

https://vcpkg.io/en/package/lua

https://vcpkg.io/en/package/luajit

Re:Swift and Cute 2D Game Framework: Setting Up a Project wi... by 90s_dev on Saturday June 07, 2025 @10:00PM (#44214025)
Because I was using Lua as a hello world test to get it all working. Ultimately I wanted to use typescript though.