The Swiftblade game engine.
  • C++ 80.1%
  • C 13.2%
  • WGSL 3.8%
  • CMake 2.5%
  • Python 0.3%
Find a file
2026-09-18 22:29:26 +02:00
cmake TinyExpr upgrade 2026-09-18 22:29:26 +02:00
content Material updates 2026-09-07 21:54:43 +02:00
include Stuff 2026-08-06 21:57:35 +02:00
library Nakama stuff? 2026-08-04 18:45:08 +02:00
source Increase dynamic buffer limit 2026-09-18 10:38:11 +02:00
.gitattributes Initial commit 2026-04-20 09:46:42 +02:00
.gitignore Nakama stuff? 2026-08-04 18:45:08 +02:00
CMakeLists.txt Prepare for template 2026-08-17 23:38:50 +02:00
gen.bat Stuff 2026-04-20 11:02:14 +02:00
LICENSE Initial commit 2026-04-20 09:46:42 +02:00
README.md Asset Packages 2026-08-13 20:43:12 +02:00
run_web.bat Stuff 2026-04-20 11:02:14 +02:00
run_web.sh Stuff 2026-04-20 11:02:14 +02:00
shell_minimal.html.in Web fixes 2026-08-31 01:04:51 +02:00

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

  1. Call Engine/gen.bat
  2. Open Engine/build/Engine.sln Or call CMake manually.

Linux

Steps:

  1. 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

  1. Clone the repository: git clone https://forge.wergeland.synology.me/harald/Swiftblade.git --recursive --shallow-submodules && cd Swiftblade

  2. Configure CMake: cmake -B build -G Ninja -S Engine

  3. Build: cmake --build build

  4. 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