Giter Club home page Giter Club logo

gengine-r's Introduction

GEngine | Re

FOSSA Status

A 2D Game Engine built on SDL2. A Rewrite of an old project of mine.

This is a work-in-progress project, expect no support.

Important Notes:

  • Use Direct3D or Software mode only as OpenGL will crash the engine when loading textures.
  • Using Metal is still untested.
  • Behavior is sometimes inconsistent depending on what GPU is being used.

Getting Started

  1. Clone the project and initialize the submodules
    git clone --recurse-submodules https://github.com/Xapier14/GEngine-R.git
    
  2. Run the script build.bat to build the project.
  3. Create a new .NET 5+ console project.
  4. Add the GEngine-R project to your solution file.
  5. Create a project reference with your game project to the GEngine-R project.
  6. Copy and paste the program boilerplate to your program.cs.
    using System;
    using System.Threading;
    
    using GEngine;
    using GEngine.Engine;
    
    namespace <your_namespace>
    {
        public class Program
        {
            private static GameEngine _game;
            public static void Main(string[] args)
            {
                // create the engine
                _game = new();
                
                // change engine properties here
                _game.Properties.Title = "GAME_TITLE";
                _game.Properties.EnableFramelimiter = true;
                _game.Properties.TargetFPS = 60;
                _game.Properties.TargetTPS = 128;
                _game.Properties.WindowResolution = new(800, 600);
                _game.Properties.InternalResolution = new(800, 600);
                _game.Properties.HideConsoleWindow = false;
                _game.Properties.EnableDebug = true;
                _game.Properties.RenderScaleQuality = RenderScaleQuality.Linear;
                _game.Properties.AllowResize = false;
                _game.Properties.AutoOffset = true;
    
                /*  Handle Window Close
                 *  Set AllowClose to true to enable interaction with the close window button.
                 *  Set HandleClose to true to use the default behavior for the close button.
                 *  The default behavior will be to call GameEngine.ForceStop(). */
                _game.AllowClose = true;
                _game.HandleClose = true;
    
                /*  Handle Window Resize
                 *  Setting this to true results in the internal resolution
                 *  being set to what the new window size is.
                 *  Recommended to be set to false if your game is using a fixed resolution (retro remakes).
                 *  
                 *  NOTE:
                 *  If you are using Gerui, set this to false; if not, ignore this.
                 *  Hook the GameEngine.OnResize event to WindowController.WindowResizeEventHook.
                 *  Gerui handles resize events differently for some components. */
                _game.HandleResize = false;
    
                // start game
                _game.Start();
    
                // load resources
                _game.ResourcesLoaded = true;
                
                // keep alive
                while (_game.Running)
                    Thread.Sleep(500);
            }
        }
    }
  7. Create & set your configuration to either x86 or x64 and use the appropriate native libraries.

To-Do:

  • Base Engine Loop
  • Frame/Logic Timing
  • Input Handler
  • Object/Scene based rendering
  • Object/Instances
  • Audio Module
  • Resources/Texture loading
  • Resources/Audio loading
  • Resource Manager
  • GameObject Event System
  • Scene Instancing
  • Physics System (Incomplete)
  • Animations
  • Object Texture Offsets
  • TCP Server/Client
  • Dynamic FPS & TPS Offset adjustment
  • CLI Dev Kit
  • Visual Studio Item Templates (GameObject & Scene)
  • Visual Studio Project Template

Known Issues

  • OpenGL & Textures with transparency.
  • Memory leak on Scene reinstancing.
  • Missing checks on adding GameObjects to scenes.
  • Initial RenderClearColor not being set on OpenGL backend.
  • Only WAV files are supported for audio.
  • Missing dependency check on launch

Dependencies

  • SDL2
  • SDL_Mixer
  • SDL_Image
  • SDL_TTF
  • SDL2-CS.Core
  • Genbox.VelcroPhysics
  • .Net 5.0 (x86)

License

FOSSA Status

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.