From 5a1825c5ec075dd8c8000a7a90369c4246a0bcda Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Thu, 16 Apr 2026 16:27:10 -0400 Subject: [PATCH] Fix the build for the new windows setup. --- README.md | 75 ++++++++++------------------------------------------- meson.build | 8 +++--- 2 files changed, 18 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index f2d524b..0dd061b 100644 --- a/README.md +++ b/README.md @@ -1,78 +1,31 @@ -# Game Dev Starter Pack +# Learn CPP Starter Project -This repository contains a simple C++ project with the basics you need to get a game in C++ going. It's meant to be an educational starting point for people interested in learning to make games in C++ from scratch. It also would be a decent starting point for building a game with other frameworks like [Raylib](https://www.libsdl.org/), [SDL2](https://www.libsdl.org/), or anything that needs to be compiled. This setup also works on Windows, OSX, and Linux and includes a "meta install" script for Windows that installs a complete C++ development environment. +This project is used in [Learn C++ the Hard Way]() to test your configuration. Please refer to [01 - +Gearing Up]() for full instructions. -I recommend you get this project working with SFML and then rework it for the other framework you want to use, but honestly SFML is really good and works well. - -## If You Just Want to Make a Game - -This project is more geared toward people who want to learn C++ by making a bunch of little games, or people who want to learn how to make games from almost nothing. If you have a burning desire to craft a game, then I recommend _not_ using this project and instead go learn any of these: - -1. [Defold](https://defold.com/) -2. [Game Maker Studio](https://gamemaker.io/en) -3. [Godot](https://godotengine.org/) -4. [Unreal Engine](https://www.unrealengine.com/en-US) -5. [O3DE](https://o3de.org/) - -Keep in mind that I've only played with each of these, and have _not_ made a full game in them, so my opinion is highly suspect. You should probably just download each one, think of a tiny little game to make, and try to make it. Pick the framework that gets the most of your game done with the least effort. - -## Windows - -If you have nothing installed then you'll want to run the `scripts/windows_setup.ps1` script to install everything. This script will run and prompt you for admin passwords as it installs what you need, so be sure to stay near your computer to type passwords in when requested. To run it do this: - -> NOTE: Instructions for install C++ on windows coming soon. - -After you have everything installed do this: +## Quick Start: Windows ```shell -make reset +powershell -executionpolicy bypass ./scripts/reset_build.ps1 make make run ``` -## macOS - -For macOS it's way easier. Get XCode and [Meson](https://mesonbuild.com/) installed. Once you have -XCode do this: - -```shell -make reset -make -make run -``` - -### "Keyboard without any keys" - -If you get a weird error message of, "We got a keyboard without any keys" it's because of a security feature in OSX. Go to `Security settings->Input Monitoring` and select your Terminal. Check it, enter your admin password, then restart your Terminal. Now you can...read the keyboard in your own software. - -No, this does not enhance security at all. These people have gone full on insane at this point. - -## Linux - -Linux is difficult because people seem to mangle their Linux into unusable territory, so it's -assumed that you know how to install a C++ compiler and Make. The only warning I have to give you -is this: - -> __WARNING__ This project is setup to build clean on every computer, which means it will _NOT_ use -> your broke as Linux hacked mangled packages. If you get errors when linking with `fmt` that's -> probably because your Linux thinks it's smart and broke that library and you're trying to link to -> it. Don't, it won't work. Just use my `meson.build` and avoid your system's packages at all -> costs. - -After that do the same thing: +## Quick Start: OSX/Linux ```shell -make reset +./script/reset_build.sh make make run ``` +## Getting Help -## Next Steps +If you have problems email help@learncodethehardway.com and I'll try to find out why. -I want the `main.cpp` to hit all the major features of SFML without getting too large, so these are some of the features I need to add: +If you're on an off brand Linux then figure out why your setup is causing problems first. +"Offbrand" means anything that's not Ubuntu. Sorry, not sorry. -1. Joystick control. -2. Drawing a floor and walls that work with the physics. -3. Possibly using the networking and threading capabilities of SFML, but not really sure for what. -4. Some kind of hit point calculator, since most everyone needs that. +In other words, if you're running everything in a Qubes OS VM with w3m as your only browser and only +"free" video codecs and a tiling window manager that only works in X11 then all of your problems are +of your own making therefore you should fix them. diff --git a/meson.build b/meson.build index 1afe272..bc14198 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ -project('sfmldemo', 'cpp', - version: '0.1.0', +project('cpp-starter-project', 'cpp', + version: '0.2.0', default_options: [ - 'cpp_std=c++20', + 'cpp_std=c++23', 'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1', ]) @@ -84,7 +84,7 @@ tests = [ 'tests/example.cpp' ] -executable('sfmldemo', +executable('demo', sources + [ 'main.cpp' ], cpp_args: cpp_args, link_args: link_args,