Skip to content

catriverr/gmeng-sdk


A Powerful, Terminal-Based 2D Game Engine written in C++.


Changelog

See what's new (8-Nov-2024) info: 10.2.0: level file binary loading | gmeng.org/changelog

Documentation

Gmeng's documentation can be found in gmeng.org. Please refer to the website for enquiries about functionality and usage.

Building

This project uses the GNU Make build system for an easy building process. Currently, Gmeng only runs on Darwin (MacOS) systems.

Requirements

Systems:
- gnu-make
- g++ with stdc++20 or gnu++20

Frameworks:
- noble-lang (included)
- liblmf (included)
- pkg-config 0.29.2 or later

Optional Utilities

Systems:
- Node.JS 19.8.1 or later
- npm 9.2.0 or later
- homebrew

Frameworks:
- ncurses/ncursesw 6.5 or later
- libcurl 8.4.0 or later
- ApplicationServices

To get started, clone the repository with

git clone https://github.com/catriverr/gmeng-sdk
git submodule update --init --recursive

Warning

You will need to run git submodule update --init --recursive
to include the sources for libraries & dependencies which gmeng uses.
Currently, gmeng uses the following libraries:

Build Options

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)
options:
    make [debug] [no-ncurses] [use-external] [warnings] [all/test/test2/compile/compile-windows]
    make configure
  • The debug option adds the -g -O0 -fsanitize=address flags to the compiler.
  • The no-ncurses option disables the auto-imports to utils/interface.cpp and types/interface.h from the gmeng.h header.
  • The use-external option enables the auto-imports to SDL2/SDL.h headers for SDL-based windows.
  • The warnings option enables -Wall so all warnings are displayed by the compiler.
  • The configure option runs the configuration utility to set up the buildconfig for a program.

Debugging

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.

make test2; lldb ./tests/out/test.o

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

Flags & Command-line Arguments

For Gmeng's command-line arguments, refer to the help page in the command-line interface via:

make; ./gmeng -help

Gmeng 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 console

Contributing

Please refer to gmeng-sdk/CONTRIBUTING for guidelines on how to contribute to gmeng.

Contact

you may contact me on discord via @catriverr, or e-mail me at [email protected].