A Powerful, Terminal-Based 2D Game Engine written in C++.
See what's new (28-Apr-2025) info: Linux compilation, make setup command | gmeng.org/changelog
Gmeng's documentation can be found in gmeng.org. Please refer to the website for enquiries about functionality and usage.
This project uses the GNU Make build system for an easy building process. Gmeng currently runs on all UNIX (macOS & linux) systems.
While a Windows port for Gmeng is being worked on it is not yet complete. If you're on a Windows machine,
install WSL (Windows Subsystem for Linux) to run Gmeng without having to change computers or boot into a different Operating System.
To get started, clone the repository and set it up with
git clone https://github.com/catriverr/gmeng-sdk
cd gmeng-sdk
sudo make setupImportant
You will need to run sudo make setup
to include the sources for libraries & dependencies which gmeng uses.
submodules
Currently, gmeng uses the following submodules:
catriverr/liblmffor interleafing and configuration file parsing,catriverr/noblefor scripting, script parsing and plugin support
libraries & utilities
homebrewfor installing & implementing libraries required by gmeng,pkg-config & pkgconffor implementing cflags for C++ compiler libraries,libcurl4-openssl-devfor easy telecommunications & networking functions,libncurses-devfor easy terminal-based UI creation on CLI commands,libasound2-dev(linux only) for the ALSA (Advanced Linux Sound Architecture) audio engine,ApplicationServices(macOS only) for the ApplicationServices general Mac Service utilities
builds:
make all (builds engine and cli)
make test (builds interface tests / test.cpp)
make test2 (builds unit tests / tests/test.cpp)
make compile (builds your target file / specified in buildoptions.mk or `make configure`)
make compile-windows (builds your target file / cross compiled to windows)
make compile-file filename=<file.cpp> (builds the file defined in filename)
make compile-file-windows filename=<file.cpp> (builds the file defined in filename, for windows target)
make compile-script filename=<file.cc> (builds the file defined in filename, as a NOBLE shared library script)
make setup (sets up the environment and installs the libraries required for gmeng to function)
make build (builds the target in Production mode, all scripts in the scripts/src directory and your target will be compiled)
options:
make [debug] [no-ncurses] [use-external] [warnings] [all/test/test2/compile/compile-windows/compile-file/compile-file-windows/compile-script/build]
make configure- The
debugoption adds the-g -O0 -fsanitize=addressflags to the compiler. - The
no-ncursesoption disables the auto-imports toutils/interface.cppandtypes/interface.hfrom thegmeng.hheader. - The
use-externaloption enables the auto-imports toSDL2/SDL.hheaders for SDL-based windows. - The
warningsoption enables-Wallso all warnings are displayed by the compiler. - The
configureoption runs the configuration utility to set up the buildconfig for a program.
Gmeng is designed and configured to be debugged with the llvm/lldb debugger. To debug different functionalities of the library, run llvm with the unit tests binary.
Gmeng as its own testing utility for internal tests. Compile with:
make test2; lldb ./tests/out/test.oto run different tests, add the -l=0,1,2,3..8 flag to the run command in lldb.
refer to the Unit Tests file to see different tests and what they do.
You may also compile with debugging parameters in clang too with the make debug (compile,build,etc..make parameters) parameter.
make debug build; lldb ./game.outThis will allow you to compile with debugger parameters.
For Gmeng's command-line arguments, refer to the help page in the command-line interface via:
make; ./gmeng -helpGmeng takes the following preprocessor definitions:
#define GMENG_NO_CURSES // false by default, for no ncurses imports, same as the make no-ncurses parameter
#define __GMENG_LOG_TO_COUT__ // false by default, streams gm_log() calls to the std::cout stream.
#define __GMENG_ALLOW_LOG__ // true by default, allows logging
#define __GMENG_DRAW_AFTER_LOG__ // false, by default draws the dev-c consolePlease refer to gmeng-sdk/CONTRIBUTING for guidelines on how to contribute to gmeng.
you may contact me on discord via @catriverr, or e-mail me at nehir@mybutton.org.
