- C++ 80.1%
- C 13.2%
- WGSL 3.8%
- CMake 2.5%
- Python 0.3%
| cmake | ||
| content | ||
| include | ||
| library | ||
| source | ||
| .gitattributes | ||
| .gitignore | ||
| CMakeLists.txt | ||
| gen.bat | ||
| LICENSE | ||
| README.md | ||
| run_web.bat | ||
| run_web.sh | ||
| shell_minimal.html.in | ||
Falchion
Falchion is a homemade engine built for the game Swiftblade.
Prerequsites
- CMake. Tested on: 4.4.0
- A c++ compiler. Tested on:
- Windows: msvc 17.14, mingw 11.0
- Linux: g++-16, clang-14
- Emscripten: 6.0.6
Setup
Windows / Visual Studio
- Call
Engine/gen.bat - Open
Engine/build/Engine.slnOr call CMake manually.
Linux
Steps:
- Install prerequsites:
-
Fedora:
sudo dnf install -y cmake ccache ninja g++ mold libstdc++-static wayland-devel libxkbcommon-devel libXcursor-devel libXi-devel libXrandr-devel libXinerama-devel openssl-devel mesa-libGL-devel libuuid-devel libzstd-devel jitterentropy-devel -
Ubuntu:
sudo apt-get update && sudo apt-get install -y git cmake ccache ninja-build pkg-config g++ mold libgl-dev libwayland-dev libxkbcommon-dev libxcursor-dev libxi-dev libxrandr-dev libxinerama-dev uuid-dev libzstd-dev libssl-dev libjitterentropy3-dev
-
Clone the repository:
git clone https://forge.wergeland.synology.me/harald/Swiftblade.git --recursive --shallow-submodules && cd Swiftblade -
Configure CMake:
cmake -B build -G Ninja -S Engine -
Build:
cmake --build build -
Run:
./build/source/Application/Application
Emscripten
Install the emsdk and dont forget to set:
-DCMAKE_TOOLCHAIN_FILE=/path/to/your/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
MinGW
There is a premade toolchain file in /cmake/Toolchains
-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/mingw-w64-toolchain.cmake
Include-what-you-use
You can analyze headers with iwyu. Check it out! If you are lucky, clang and iwyu will already be correctly set up after downloading. Test by comparing clang -print-resource-dir to include-what-you-use -print-resource-dir. These have to match exactly.
Otherwise (or if using custom clang-version):
- Find the path to your clang-version:
clang-(version) -print-resource-dir-> path
- Compile iwyu with the path by adding these to your cmake command:
-DIWYU_RESOURCE_RELATIVE_TO=clang-DIWYU_RESOURCE_DIR=[path]
Append these to your cmake command (can be done in the "profiles" section in Rider/CLion):
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=path/to/include-what-you-use
If you are using a custom clang version you have to create a fake gcc toolchain for iwyu:
mkdir $MYTOOLCHAIN
cd $MYTOOLCHAIN
ln -s /usr/include include
ln -s /usr/bin bin
mkdir -p lib/gcc/x86_64-linux-gnu/ # clang will deduce which gcc version based on what's available
cd lib/gcc/x86_64-linux-gnu/
ln -s /path/to/gcc/$VERSION $VERSION
And finally, add to your cmake command:
--gcc-toolchain=$MYTOOLCHAIN
Libraries
- Box3D (MIT)
- Earcut (ISC)
- FastNoiseLite (MIT)
- HarfBuzz (Old MIT)
- MeshOptimizer (MIT)
- Miniaudio (MIT)
- Nakama (Apache-2.0)
- NanoSVG (zLib)
- PicoSHA2 (MIT)
- RapidJSON (MIT)
- STB (MIT)
- TinyExpr++ (zLib)
- TinyGLTF (MIT)
- TinyObjLoader (MIT)
- Tracy (BSD 3-Clause)
- WebGPU-Distribution (MIT)
- glfw (zLib)
Standards
Code:
#define MACRO()
namespace Context
{
class ExampleClass
{
void Func(Var InParameter, Var& OutParameter)
{
Var localVar;
OutParameter = someVariable.DoSomething();
}
Var memberVar;
}
enum ExampleEnum
{
VALUE_0,
VALUE_1,
...
}
}
Files:
content/Folder
FileName.h
FileName.cpp
FileName.hpp