Skip to content

Forge ๐Ÿ”ฅ is a lightweight 2D game engine built with C++. Easy to learn ๐ŸŽ“, quick to set up โšก, and made to bring my game ideas to life ๐ŸŽฎโœจ.

Notifications You must be signed in to change notification settings

MagedGDEV/Forge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Forge โš’๏ธ

Forge is a lightweight 2D game engine built in C++ with Lua scripting for flexible game logic. Itโ€™s designed to be simple to set up, fast to build, and easy to extend, making it a solid foundation for creating 2D games.

  • C++ core for performance.
  • Lua + Sol2 integration for intuitive scripting.
  • Dependency management with CPM โ€” no manual library setup.
  • Currently focused on 2D development (future-ready for more).

Recommended Built Setup

  • Use CMake with Ninja for faster builds.

  • Add the following to your CMake configure arguments:

    -DCMAKE_POLICY_VERSION_MINIMUM=3.5

Dependencies

The engine depends on the following libraries:

  • SDL2
  • SDL2_ttf
  • SDL2_image
  • SDL2_mixer
  • GLM
  • Dear ImGui
  • Lua
  • Sol2

Warning

You need a GitHub account configured on your machine (SSH or HTTPS) since all libraries are fetched directly from GitHub.

CPM Setup (Required)

Forge uses CPM.cmake a CMake-based package manager that automatically fetches dependencies (like SDL, ImGui, Lua, etc.) directly from GitHub. This means you donโ€™t need to install these libraries manually.

To make CPM efficient:

  1. Create an environment variable called CPM_SOURCE_CACHE.
  2. Point it to an empty folder where CPM will store downloaded dependencies.

Caution

Without this, CPM will re-download all libraries every time you do a clean build.

Platform Setup

Each operating system requires a different setup process to ensure SDL and its dependencies work correctly. If you donโ€™t follow these steps, CMake will fail during configuration and let you know exactly which libraries or tools are missing.

macOS ๐ŸŽ

  • Install required SDL dependencies with Homebrew:

    brew install opus
    brew install libxmp
    brew install fluidsynth
    brew install wavpack
  • Fix: In opusfile.h, replace

    #include <opus_multistream.h>

    with

    #include "opus_multistream.h"

Windows ๐ŸชŸ

  1. Install NASM Assembler (stable version).
  2. Add it's path to your environment variables.
  3. Run CMake from Developer Command Prompt for VS (required for Microsoft Macro Assembler).

If using VSCode / VSCodium, configure your terminal to always launch Developer Command Prompt as example below:

"terminal.integrated.profiles.windows": {
    "VS": {
        "path": "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/VSDevCmd.bat",
        "args": []
    }
},
"terminal.integrated.defaultProfile.windows": "VS",

Note

Make sure to add your actaul path to VSDevCmd.bat

Linux ๐Ÿง

Coming soon ๐Ÿšง

About

Forge ๐Ÿ”ฅ is a lightweight 2D game engine built with C++. Easy to learn ๐ŸŽ“, quick to set up โšก, and made to bring my game ideas to life ๐ŸŽฎโœจ.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published