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 wort…
Swift and the Cute 2d game framework: Setting up a project with CMake
41–50 of 85 posts
Re: Swift and the Cute 2d game framework: Setting up a project with CMake
#42Earlier quoted context omitted.
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++.
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.
- 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 the Cute 2d game framework: Setting up a project with CMake
#43Last 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 wort…
What's the relation of your comment to this blog post?
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 the Cute 2d game framework: Setting up a project with CMake
#44Last 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 wort…
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 the Cute 2d game framework: Setting up a project with CMake
#45> For many games variable timestep is a good choice. It really isn't.
You can use fixed time step. Choice is yours.
https://randygaul.github.io/cute_framework/#/topics/game_loo...
Re: Swift and the Cute 2d game framework: Setting up a project with CMake
#46> For many games variable timestep is a good choice. It really isn't.
Care to elaborate?
Re: Swift and the Cute 2d game framework: Setting up a project with CMake
#47> For many games variable timestep is a good choice. It really isn't.
If you divorce the game's time-step from your math it isn't too much of an issue. You just need to keep track of the time-delta so you have it for your calculations.
Re: Swift and the Cute 2d game framework: Setting up a project with CMake
#48Thanks for sharing a simple setup that avoids SwiftPM. It is nice to have more options. Swift has to shed the perception that it only works on apple platforms. I've found the the C++ interop to be pretty good for my computer vision use cases.
Re: Swift and the Cute 2d game framework: Setting up a project with CMake
#49Re: Swift and the Cute 2d game framework: Setting up a project with CMake
#50> For many games variable timestep is a good choice. It really isn't.
Care to elaborate?
You can request a fixed timestep, and your own loop callback will be called at fixed intervals, which allows you to completely ignore delta time.