-
Notifications
You must be signed in to change notification settings - Fork 38
Setting up your computer
Ravbug edited this page Mar 2, 2025
·
7 revisions
If you're a complete beginner, then this is the guide for you!
- Download the Visual Studio Community Edition installer from visualstudio.microsoft.com/vs/ and run it.
- What about Visual Studio Code? Visual Studio is not the same as Visual Studio Code. Don't use Visual Studio Code for C/C++ development unless you're an expert. If you're reading this page, that's not you.
- Choose the latest Visual Studio version. When you are prompted to install additional modules, select the Desktop Development in C++ module.
- Hit install and wait for it to finish.
- Open Visual Studio. After completing the first-launch setup, you'll see a window that looks like this:
- Press Clone a Repository. Paste
https://github.com/Ravbug/sdl3-sampleinto the Repository Location field. Then press Open - Select Folder View in the Solution Explorer - Views panel
- Select sdl-min.exe (Debug\sdl-min.exe) in the dropdown under the green run button.
- Press the green triangle button to build and run. If all goes well, you'll see this!
- To modify the sample, find the
main.cppfile in the Solution explorer.
- Install Xcode via the App Store.
- Wait for Xcode to finish installing.
- Download CMake from cmake.org/download. Find "Latest Release", then find "Binary Distributions" and find the link labeled "macOS 10.13 or later."
- Open the downloaded
.dmgfile, and drag CMake to the Applications folder. - Use Spotlight (cmd+Space) to open Terminal. You'll see a window that looks like this:
- The terminal window is currently at your Home folder. If you type
lsand hit enter, you'll see your Documents, Desktop, Downloads, and other folders listed there. Typecd ~/Downloadsand hit enter. The terminal is now in your Downloads folder. - We're now going to download the code for this repository. In the terminal window, run
git clone https://github.com/Ravbug/sdl3-sample --recurse-submodules --depth=1- What did this do? It told
gitto download the code for the sample, as well as the code for SDL (--recurse-submodules) and to not download the entire change history (--depth=1).
- What did this do? It told
- We're done with the terminal now, so you can close it.
- Open CMake. You'll see a window that looks like this:
-
- Click the
Browse Sourcebutton and select thesdl3-samplefolder. It'll be in your Downloads folder if you followed along with the earlier steps. - Click the
Browse Buildfolder. Make a new empty folder somewhere using theNew Folderbutton in the Open dialog, then pressOpen. - Press the
Generatebutton at the bottom of the CMake window. Choose the Xcode generator. Leave the other settings to their defaults.
- Wait for this to complete. It can take around 5-10 minutes. You'll see some logging appear in the blank area at the bottom of the CMake window. When it completes, you'll see some red text appear in the CMake window. This is OK.
- What is this doing? CMake is creating an Xcode project file for you.
- Press the
Open Projectbutton at the bottom of the CMake window. This will launch Xcode on the generated project file. - Press the Run button. Xcode will build SDL and the example code, then launch it. If all goes well, you should see this!
- Start modifying this sample (
main.cpp) to add your own things to it. If you add additional.cppor.hfiles, You'll need to pressGeneratein the CMake window again so that CMake adds them to the Xcode project.
Because you're on Linux, this section will be shorter than the others as familiarity with a terminal, git, and package managers is expected. If you don't know any of the terms I just mentioned, then please learn about those first.
- Open your favorite terminal and use your package manager to install:
- clang or gcc
- cmake
- git
- X11 development libraries (if you use X11)
- Wayland development libraries (if you use Wayland)
- ALSA, Pulse, or JACK development libraries (for sound output)
- OpenGL development libraries (for hardware accelerated rendering)
-
cdto where you want the sample to download git clone https://github.com/Ravbug/sdl3-sample --recurse-submodules --depth=1cd sdl3-sample-
cmake -S . -B build- CMake will generate a Makefile by default. If you want to generate a Ninja file instead, add
-G Ninjato the command. You will also need to install Ninja via your package manager.
- CMake will generate a Makefile by default. If you want to generate a Ninja file instead, add
- Wait for CMake to finish generating a Makefile inside the
buildsubfolder cmake --build build --parallel --target sdl-min- If all goes well, you'll have a runnable executable inside
build. If you run it, you should see a rainbow window appear.


