A very capable, yet simple 2D game engine made entirely for hobby purposes. It is full of features that target 2D games/applications, with no plans to target 3D any time soon. It is purely a 2D game engine. It currently supports Windows with minimal Linux support.
- Cross-platform window creation with OpenGL 4.5+.
- Gamepad, keyboard, and mouse input support.
- A flexible and configurable 2D renderer, using modern OpenGL (4.5+).
- A fully-fledged audio system with both 2D and 3D spatialized audio.
- A robust and easy-to-use game UI system, using HTML and CSS to decalre and style widgets.
- A robust 2D physics engine, using the fantastic Box2D library.
- A flexible Entity Component System (ECS) module, using the EnTT library.
- Integrated ImGui support, featuring an abstracted
editorlayer for editing engine-specific types through a GUI.
Before proceeding with any build or compilation step, Freya needs to be cloned from the Git repo.
git clone https://github.com/FrodoAlaska/Freya.gitAnd now that Freya is cloned, we can start the build process...
In general there are two ways to build Freya. The first to use CMake commands just like any other C++ project. The second way is to use a handy build script to manage the build project for you.
There are two main ways to build Freya. The first is to use the traditional CMake commands below:
mkdir build
cd build
cmake .. CMake will generate the required build files, but it will also fetch all of the dependencies mentioned above. This is all handled by CMake itself, so you don't have to worry about any specifics.
And then to build Freya you can use:
cmake --build . --config Debug --parallel 12The command above will build Freya in the debug configuration, using 12 worker threads. You can omit the --parallel flag if you so wish. However, since Freya will build all of the dependencies itself, it might take a while.
Now the second way to build Freya is to use the build scripts found in the scripts directory. There are a few build scripts but there are only two important ones: build-freya.sh for Linux and build-freya.ps1 for Windows. Each script takes in a few flags to make both the development and build process easier.
[Usage]: .\build-freya.ps1 [options]
An easy to use build script to build Freya on Windows
--clean = Have a new fresh build
--debug = Build for the debug configuration
--rel = Build for the release configuration
--jobs [threads] = Threads to use when building
--run-testbed = Run the testbed examples
--help = Display this help message
Currently, the --run-testbed flag can only run a single testbed, but there are plans to expand on this in the future.
The --debug and --rel must be used independently. Moreover, one of the flags have to be used to know which configuration to build for. If none of them are used, the script will default to a Debug build. Depending on which flag is passed to the build script, a build-debug and/or build-release will be created in the main directory. Any build artifacts generated by --run-testbed will be dumped into one of the previously mentioned directories.
Of course, the project can be built regardless of this build script. This is not a necessary step. It is only a convenience for the development process on our end.