A lightweight, cross-platform 2D game library for modern C++ development.
JNGL (Just a Neat Game Library) is an easy-to-use C++ game development library that runs on multiple platforms, including:
- Linux
- Windows
- macOS
- Android
- iOS
- Xbox
- Nintendo Switch
- LG webOS
- Web (via Emscripten)
- Simple API for fast game development
- Cross-platform support with minimal configuration
- Hardware-accelerated rendering
- Built-in support for audio, fonts, and textures
- Open-source and lightweight
To get started, follow these build instructions for your platform.
cmake -Bbuild
cmake --build build
./build/jngl-test
sudo apt-get install libgl1-mesa-dev libfreetype6-dev libfontconfig1-dev libpng-dev \
libxxf86vm-dev libvorbis-dev cmake g++ libwebp-dev git libsdl2-dev
sudo dnf install fontconfig-devel freetype-devel libvorbis-devel libwebp-devel \
cmake SDL2-devel gcc-c++ libatomic
pacman -Syu --needed cmake gcc sdl2 pkg-config fontconfig libwebp libvorbis
Set up MSYS2 and install the required dependencies:
pacman -Syu --needed mingw-w64-x86_64-gcc \
mingw-w64-x86_64-freetype mingw-w64-x86_64-libvorbis mingw-w64-x86_64-libwebp \
mingw-w64-x86_64-dlfcn mingw-w64-x86_64-cmake make mingw-w64-x86_64-gdb \
mingw-w64-x86_64-libtheora mingw-w64-x86_64-SDL2
cmake -Bbuild -DFETCHCONTENT_QUIET=0
Then open build/jngl.sln
in Visual Studio.
Install dependencies using Homebrew:
brew install sdl2 freetype libvorbis webp pkg-config cmake
- Install the Android SDK and set
ANDROID_HOME
to point to it. - In the Android SDK Manager, install the NDK build tools.
- Run the following command to test via ADB:
make -C android run
Alternatively, open android/test
in Android Studio and build from there.
Generate an Xcode project using CMake:
cmake -Bbuild-ios -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/iOS.toolchain.cmake -DIOS_PLATFORM=SIMULATOR
Then open and build build-ios/jngl.xcodeproj
in Xcode.
cmake -Bbuild-uwp -DCMAKE_SYSTEM_NAME=WindowsStore "-DCMAKE_SYSTEM_VERSION=10.0"
Then open build-uwp/jngl.sln
in Visual Studio.
Here's a simple "Hello, World!" example in JNGL:
#include <jngl.hpp>
void step() {
jngl::setColor(255, 255, 255);
jngl::drawText("Hello, JNGL!", jngl::Vec2(100, 100));
}
int main() {
jngl::setStepCallback(step);
jngl::run();
return 0;
}
If you'd like to contribute:
- Fork the repository and create a new branch.
- Follow the coding guidelines.
- Submit a pull request with a clear description of your changes.
JNGL is licensed under the zlib license. See LICENSE for details.
For more details, visit the official documentation.