Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/geode-sdk/docs into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Jan 7, 2024
2 parents c71c434 + f259007 commit f374629
Show file tree
Hide file tree
Showing 38 changed files with 563 additions and 465 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ jobs:
- name: Download Flash
uses: robinraju/[email protected]
with:
repository: hjfod/flash
repository: geode-sdk/flash
latest: true
fileName: "flash.exe"
tarBall: false
zipBall: false
out-file-path: ""

- name: Create dist directory
run: |
mkdir dist
- name: Build docs with Flash
run: |
cd dist
cd dist
./../flash.exe -i ../geode -o .
- name: Setup Pages
Expand Down
Binary file added assets/Set_Env_Var.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 18 additions & 2 deletions cpp/declarations.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int someFunction(int a, int b);
class SomeClass;
```
These are also known as **forward declarations**. They are telling the compiler that you a symbol will exists, but you will only define it later on.
These are also known as **forward declarations**. They are telling the compiler that a symbol will exist, but you will only define it later on.
Forward declarations are most useful (and also necessary) when dealing with symbols that depend on each other, for example functions that call each other:
Expand Down Expand Up @@ -84,7 +84,23 @@ void sayHi() {
}
```

Of course, this example is quite simple, and not what most commonly causes headaches for new modders. The most common source of ODR problems is due to headers.
Another important thing to note about ODR is that **it applies across all source files**. That is, if you have two different source files:

```cpp
// hi.cpp
void sayHi() {
std::cout << "Hi mom!" << std::endl;
}

// hello.cpp
void sayHi() {
std::cout << "Hello mom!" << std::endl;
}
```

**This will also be considered an ODR violation.** Any definition of a C++ symbol in a source file is (usually) automatically visible to all other files, so the compiler will notice you have defined a function in multiple different sources and won't be able to decide which one to use.

However, you will most likely rarely encounter ODR due to source files; rather, the most common source of ODR problems is due to headers.

Say you have the following header, `hi.hpp`:

Expand Down
4 changes: 4 additions & 0 deletions cpp/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
order: 999
---

# C++ Tutorials

This is a collection of tutorials for C++, ranging from basic language features to compiler-specific UB. This is intended as **supplemental** material for GD modders who are new to modding and C++ - **it should not be regarded as a full tutorial**. To learn C++, you should seek more information from sites such as [W3Schools](https://www.w3schools.com/cpp/default.asp) and [learncpp](https://www.learncpp.com/).
40 changes: 0 additions & 40 deletions faq.md

This file was deleted.

53 changes: 0 additions & 53 deletions geode/creating.md

This file was deleted.

5 changes: 0 additions & 5 deletions geode/index.md

This file was deleted.

38 changes: 0 additions & 38 deletions geode/installcli.md

This file was deleted.

37 changes: 37 additions & 0 deletions getting-started/cpp-stuff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: 1.1. Required C++ Tools
order: 2
---

# Required C++ Tools
To be able to use the Geode SDK, you **will** need at least the following:
* [A C++ compiler](#compiler)
* [CMake](https://cmake.org/download/)
* [git](https://git-scm.com/downloads)

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

### Windows
From the [Visual Studio](https://visualstudio.microsoft.com/downloads/) website, you can download the Visual Studio IDE along with the compiler. If you want **just** the compiler, look for *Build Tools for Visual Studio* further down in the page.

After launching the installer, look for **Desktop development with C++**. You may choose other features, but you **will** need at least ***MSVC*** and ***Windows SDK*** installed.

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

### MacOS

Install [brew](https://brew.sh/) if you don't already have it, and then run:
```bash
brew install llvm
```

### Linux
Linux is a bit more complicated, as obviously there's no linux release of GD (yet). Of course, you can run the Windows version of GD through software like [wine](https://www.winehq.org/) quite well, which is probably what you're already doing.

Because of that, this guide will set you up to [cross-compile](https://en.wikipedia.org/wiki/Cross_compiler) windows Geode mods from linux.

We recommend reading this gist: [linux-win-cross.md](https://gist.github.com/matcool/abb65ee59ded3766717c673014c3a2a7) for up to date information on how to cross compile.
46 changes: 46 additions & 0 deletions getting-started/create-mod.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: 3. Creating and building a new mod
order: 5
---

# Creating a new mod
After all that setup, you can now create your first mod!

To do this, open up a terminal where you want to create your project and run:
```bash
geode new
```
Follow the given prompts and afterwards you should have a new folder containing the code for your mod.

## Files

You may notice the project already comes with a few files. Lets go over them:
- `CMakeLists.txt` - This is the main file for your CMake project.
- `about.md` - Here you can write a very long description page for your mod, in markdown. Think of it as a README for your mod! This file is technically optional, but highly recommended.
- `logo.png` - This is the icon for your mod, which shows up in-game. This file is technically optional, but highly recommended.
- `mod.json` - This json file contains all the metadata about your mod, such as name, version, custom resources, settings, etc. [See this page for detailed info](/mods/configuring)

If you plan on releasing your mod, **please** edit the about.md and logo.png files!

The source code for your mod can be found inside the `src` folder.

## Additional Files
Geode will also look for these special files within your mod folder:
- `changelog.md` - Lists all of the changes between versions to the mod; [see detailed info](/mods/md-files)
- `support.md` - Is free-form info about how to show support to the developer of the mod; [see detailed info](/mods/md-files)

# Build
Now, to build your mod you have a few options: \
If youre using an IDE such as Clion, VScode or Visual Studio, head over to the [IDE Setup](/getting-started/ide-setup) page.

Otherwise if you want to build your mods manually from the command line you can do that by simply running these commands in your mod's folder:
```bash
# Configure CMake (WINDOWS)
cmake -B build -A win32

# Configure CMake (Other platforms)
cmake -B build

# Build the project
cmake --build build --config RelWithDebInfo
```
66 changes: 66 additions & 0 deletions getting-started/geode-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: 1.2. Geode CLI
order: 3
---

# Geode CLI
The Geode SDK has its own command line utility program to aid in many tasks involved in mod, such as asset packing, font generation, managing the SDK, etc.

# Installation

* [Windows](#windows)
* [MacOS](#macos)
* [Linux](#linux)

## Windows
(Recommended) You can use [scoop](https://scoop.sh/) to easily install the cli by doing:
```bash
scoop install https://geode-sdk.org/geode-sdk-cli.json
```

If you don't have scoop, you can follow the installation instructions on their page:
[https://scoop.sh](https://scoop.sh)

---

Otherwise, you can manually install it by:
1. Download the latest windows release over at [GitHub](https://github.com/geode-sdk/cli/releases/latest)
1. Extract the `geode.exe` into some folder on your computer
1. Select the CLI executable in File Explorer, Shift + Right-Click it and select `Copy as Path`
1. Search `Edit the system environment variables` on Windows search. Alternatively, you can open up Control Panel and search for it, then select `Edit the system environment variables` or **to skip straight to step 6 select `Edit environment variables for your account`**.
1. Click `Environment Variables...`
1. In the top `User variables` section, select the `Path` variable and click `Edit`
1. Now click `New` and paste the path of the CLI executable you copied at Step 1. **Remove the `\geode.exe` from the end;** the path has to point to the _directory_ with Geode CLI, not the CLI itself.
1. Click OK to close the environment variable windows.

---

After either way of installing it, you should now be able to run `geode --version` in your cmd and see a version number!

It is recommended that you [set up a profile now](#profile-setup).

## MacOS

You can easily install the CLI via [brew](https://brew.sh)
```bash
brew install geode-sdk/geode/geode-cli
```

It is recommended that you [set up a profile now](#profile-setup).

## Linux

We provide prebuilt linux binaries in the CLI releases page, which you can find here: \
[https://github.com/geode-sdk/cli/releases/latest](https://github.com/geode-sdk/cli/releases/latest)

Since this is different per distro, you must figure out how to add this binary to your path for CMake to find it.

Once you figure that out, it is recommended that you [set up a profile now](#profile-setup).


# Profile Setup

A profile is just an instance of Geometry Dash. It's a good idea to set up one up for CLI so your mods can be automatically installed post build.

To setup a new profile, simply run the `geode config setup` command on your terminal.

Loading

0 comments on commit f374629

Please sign in to comment.