Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/win_compilers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/win_usecmake.png
Binary file not shown.
12 changes: 6 additions & 6 deletions getting-started/cpp-stuff.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@ To be able to use the Geode SDK, you **will** need at least the following:
## Compiler

To use the Geode SDK, and in turn make Geometry Dash mods, you will need either:
* [Clang](#windows-clang) (recommended) or [Visual Studio 2022+](#windows-visual-studio) on Windows
* [Clang](#windows) on Windows
* [Clang](#macos) on MacOS
* [A secret third thing](#linux) on Linux

### Windows (Clang)
### Windows

First, install [LLVM](https://github.com/llvm/llvm-project) and [Ninja](https://github.com/ninja-build/ninja). The easiest way is using Scoop:
```
scoop install llvm ninja
```

LLVM itself does not come with Windows SDK and CRT libraries, so you will need a minimal Visual Studio install for these, which is described in the next section.
LLVM itself does not come with Windows SDK and CRT libraries, so you will need a minimal Visual Studio install for these.

### Windows (Visual Studio)
Unless you want to install Visual Studio (the editor) itself, we recommend installing just the build tools. Open the VS [download page](https://visualstudio.microsoft.com/downloads/), scroll to the bottom, and under "Tools for Visual Studio" download **Build Tools for Visual Studio**.

Please note that Visual Studio **2022** or higher is required. If you have an older version already installed, you should upgrade to the latest available.

Unless you want to install Visual Studio (the editor) itself, we recommend installing just the build tools. Open the VS [download page](https://visualstudio.microsoft.com/downloads/), scroll to the bottom, and under "Tools for Visual Studio" download **Build Tools for Visual Studio**.

After launching the installer, select **Desktop development with C++** and optionally deselect all features except for **MSVC Build Tools** and **Windows SDK**, like on the screenshot below. Click Install and wait for it to finish.

![Image showing VS installer](/assets/vs_installer.png)

Once Visual Studio is installed, you should now have a working C++ compiler that is suited for GD mod development.

Note that although it is possible to use MSVC from Visual Studio on its own to compile Geode mods, we **do not** recommend using it, since you may not be able to compile a mod using it (MSVC likes to run into segfaults while compiling certain libraries), and it is also slower overall.

### MacOS

Install [brew](https://brew.sh/) if you don't already have it, and then run:
Expand Down
2 changes: 1 addition & 1 deletion getting-started/geode-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ order: 3

# Geode CLI

Geode has its own CLI tool to aid in many tasks involved in making mods, such as packing assets, generating fonts, managing installed SDK versions, etc.. While it is technically possible to use Geode without the CLI, there is little reason not to install it as **it's required for nearly everything in practice**.
Geode has its own CLI tool to aid in many tasks involved in making mods, such as packing assets, generating fonts, managing installed SDK versions, etc. While it is technically possible to use Geode without the CLI, there is little reason not to install it as **it's required for nearly everything in practice**.

# Installation

Expand Down
21 changes: 7 additions & 14 deletions getting-started/ide-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,23 @@ You can use one of the following IDEs for developing Geode mods. Using an IDE is
Install the following VSCode extensions:
* [`CMake Tools`](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools)
* [`Geode`](https://marketplace.visualstudio.com/items?itemName=GeodeSDK.geode) - Not required, but will provide some nice features.

As well as one of:
* [`clangd`](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) - **if using Clang as compiler**
* [`C/C++`](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) - **if using MSVC / Visual Studio as compiler**
<!-- consider still recommending because it provides an integrated debugger on windows but it will break clangd unless you disable intellisense -->
<!-- * [`C/C++`](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) - **if using MSVC / Visual Studio as compiler** -->

There are a few steps you should follow to get proper intellisense and code completion (you should only need to do these once per project, ideally):

1. With VS Code open on your project, press F1 and run `CMake: Select a Kit`. This will bring up a list of installed compilers on your machine. This will also open automatically whenever opening a new project.

![Image showing a bunch of compilers CMake detected in VS Code](/assets/win_compilers.png)

Depending on which compiler you want to use, pick either:
* **Clang** (not `Clang-cl`) - recommended
* **Visual Studio 20xx Release - amd64** (not `amd64_x86` or any other ones)
You should pick **Clang** from the list (not `Clang-cl` or `Visual Studio`).

2. Now to select the build variant, press F1 and run `CMake: Select Variant`. We recommend **RelWithDebInfo** for easier debugging, as **Debug** may sometimes cause obscure crashes.
2. Now to select the build variant, press F1 and run `CMake: Select Variant`. We recommend **RelWithDebInfo** for easier debugging, as **Debug** may sometimes cause obscure crashes, and Debug builds cannot be distributed outside of your system.

![Image showing available build types on Windows: Debug, Release, MinSizeRel, and RelWithDebInfo](/assets/win_relwithdebinfo.png)

3. If using **Clang** with the **clangd** extension, press F1 and run `CMake: Edit User-Local CMake Kits`. This will open a file, in there find the chosen kit (one with Clang in the name) and add these keys to it:
3. Press F1 and run `CMake: Edit User-Local CMake Kits`. This will open a file, in there find the chosen kit (one with Clang in the name) and add these keys to it:
```json
"cmakeSettings": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
Expand All @@ -58,10 +55,6 @@ Additionally, we recommend disabling clangd auto header insertion, as it doesn't
],
```

4. If instead of Clang you chose the **C/C++ extension**, you need to register CMake as the **Configuration Provider** for the C++ extension by pressing F1 and running `C/C++: Edit Configurations (UI)`. Scroll down to **Advanced** options, and set the Configuration Provider as `ms-vscode.cmake-tools`.

![Image showing the "C/C++: Edit Configurations (UI)" command being run in VS Code](/assets/win_usecmake.png)

Now, build your mod by pressing F1 and running `CMake: Build`. **You must build your mod first so that errors such as `#include <Geode/modify/MenuLayer.hpp> not found` go away.** If the mod was built successfully, the exit code at the end should be 0. If any errors still persist after building the mod, try restarting VS Code.

## VSCode on Mac
Expand Down Expand Up @@ -173,7 +166,7 @@ After that, in the Open Project Wizard, you need to make sure that:
2. Toolchain is set to *Visual Studio* or *Clang/LLVM*
3. Generator is set to *Visual Studio 17 2022* or *Ninja* (if you have it installed)

In the end it should look like this:
In the end it should look like this:

![Image showing the CLion Open Project Wizard set up for Geode](/assets/clion_openprojectwizardsetup.png)

Expand Down Expand Up @@ -217,5 +210,5 @@ Now, in the toolchain settings on the right side of the **Name** field, click th

After that, you can follow the same steps as on Windows to build your mod.

For some specific mods/libraries (most people won't need this), you might also want to add the clang-cl toolchain. Everything is the same as with clang, except you have to use the `clang-cl-msvc.cmake` toolchain file instead. (Copy the environment file and change the `CMAKE_TOOLCHAIN_FILE` variable to point to the `clang-cl-msvc.cmake` file.)
For some specific mods/libraries (most people won't need this), you might also want to add the clang-cl toolchain. Everything is the same as with clang, except you have to use the `clang-cl-msvc.cmake` toolchain file instead. (Copy the environment file and change the `CMAKE_TOOLCHAIN_FILE` variable to point to the `clang-cl-msvc.cmake` file.)
Also make sure you're using `clang-cl` as the compiler in the toolchain settings.
2 changes: 1 addition & 1 deletion getting-started/what-next.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ order: 7

# What next?

You should now be set on your journey to develope GD mods! If you are completely new to GD modding, a good place to start is [the Handbook](/handbook/chap0), which covers all of the basics of creating a Hello World.
You should now be set on your journey to develop GD mods! If you are completely new to GD modding, a good place to start is [the Handbook](/handbook/chap0), which covers all of the basics of creating a Hello World.

## Geode Features

Expand Down