GithubHelp home page GithubHelp logo

billy4479 / billyengine Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 1.18 MB

Some kind of a 2D engine based on OpenGL and EnTT

License: MIT License

CMake 7.54% C++ 84.40% GLSL 0.57% Shell 1.25% C 5.48% C# 0.08% SWIG 0.68%
game-engine entt cpp opengl

billyengine's Introduction

Billy Engine

Build Status

Some kind of 2D game engine, written in C++20 using OpenGL and EnTT to be used in future projects. I wanted a simple entity framework to display some graphics in my C++ applications and here it is. It is not meant to be like Unreal / Unity / Godot, the most similar thing I could find is olcPixelGameEngine and raylib. Thanks also to TheCherno for Hazel from which I took a lot of inspiration.

I've developed it in Linux for Linux but should work on other platforms as well. Windows is WIP, OSX will probably not work. I'm not targeting mobile. WASM may be interesting but definitely not a priority.

There's still a lot of work to do, check out TODO.md

It started using SDL2 for rendering but switching to OpenGL gives more customization and advanced features. Also, linking SDL2 on windows is a pain.

How to use

You can look at the code in the demo folder for now as there is no documentation and the API is really unstable.

C# Bindings are also available through SWIG. An example is available here.

In the future I might distribute a precompiled Nuget package, but for now everything has to built from scratch.

Dependencies

  • OpenGL
  • GLFW
  • EnTT
  • fmt
  • glm
  • spdlog
  • stb_image
  • Dotnet CLI (optional)
  • CMake (build)
  • Ninja (build, optional)
  • SWIG (build, optional)
  • Nuget CLI (build, optional)

Build

This repository contains the source for the engine itself that gets compiled to a dynamic library and a little demo.

cmake -S . -B build # `-G Ninja` is recommended but not required
cmake --build build

Some options that you can pass to cmake include:

  • -D COMPILE_DEMO=OFF to disable the demo
  • -D BUNDLE_DEPENDENCIES=OFF to get multiple DLLs for each dependency. By default they are bundled into a single DLL
  • -D SYSTEM_DEPENDENCIES=ON to build the engine using packages on the system instead of downloading and compiling them (some dependencies will still be compiled because they are non-standard and usually not packaged). This works well on Linux, in particular, on Arch you would need to yay -S entt fmt glm glfw-x11 spdlog. On the other side this option is not recommended on Windows and when generating C# bindings
  • -D GENERATE_BINDINGS=ON is on by default and generates C# bindings using SWIG. Can be disabled if not needed.

Additionally some convenience scripts are provided in the script folder:

  • valgrind.sh runs the C++ demo through Valgrind and logs the result to valgrind.log
  • cross.sh cross compiles from Linux to Windows with MinGW (experimental)
  • bindings.sh generates C# bindings, projects and packages. It is recommended to run this script before using the C# demo

billyengine's People

Contributors

billy4479 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.