Skip to content

accidentalrebel/rebel-game-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rebel Game Engine

A 3D game engine using C with Lisp scripting.

The engine is an application of the lessons I've learned researching game engines and poking around various open source projects. I don't plan to use it for production but it might eventually evolve into something that will. The primary goal for now is implementing the barest essentials.

For more information check out the wiki for more info.

screenshot-1

Sample Code

Simple program that loads a 3d model and draws it. Also has first person camera movement.

(define *basic-shader*)
(define *backpack*)

;; Setup the first person camera extension
(include-relative "../../extensions/fpcam")

(define (init)
  ;; Load the model object
  ;; model:load also loads the textures automatically
  (set! *backpack* 
	(model:load "assets/models/backpack/backpack.obj"))

  ;; Load a basic shader
  (set! *basic-shader* 
	(shader:create "shaders/model-loading.vs" "shaders/model-loading.fs")))

(define (update)
  ;; This is needed for the first person camera extension to work
  (fpcam:update))

(define (render)
  (window:clear '(0.1 0.1 0.1))

  ;; Use the basic-shader
  (shader:use *basic-shader*)

  ;; Draw the backpack model
  (renderer:draw *backpack* '(0 0 0) '(1 1 1))
  
  (window:swap))

Features

  • Window management
  • Drawing sprites
  • Coordinate system
  • Scripting Integration
  • Multiplatform development
  • Camera System
  • Basic Lighting
  • Model loading
  • Sprite transparency
  • Bitmap text rendering
  • Playimg audio

Getting started

Details on how to download the engine, build, and run a sample program can be found on the wiki here.

You could also check out the examples folder.

Dependencies / External Libraries

As much as I want to implement everything myself, these libraries are just better so no need to re-invent the wheel.

  • Glad - OpenGL Loader-Generator
  • GLFW - For OpenGL and window handling
  • CGLM - Highly optimized graphics math for C
  • stb_image - Image loader
  • shader.h - LearnOpenGL's shader class
  • chicken-scheme - Enables lisp scripting
  • assimp - For loading 3d models

Writeups

Many thanks

This project wouldn't be possible without these:

  • Handmade Hero - The project that started my journey to appreciating hand-made programs and applications.
  • LazyFoo's SDL Tutorials - I did not use SDL for this engine but I learned about it using these excellent tutorials.
  • LearnOpenGL - An excellent site containing tutorials about OpenGL. Ramps up from beginner to advanced concepts quite nicely.
  • Raylib - An excellent game programming library that has very simple and readable code.
  • Raylib-Chibi - A chibi-scheme implementation for the Raylib library. Scripting on my engine won't be possible without this as a reference.
  • Myriad Game Engine - A bare bones game engine that I used to learn about OpenGL loading without GLFW.

About

A 3D game engine using C with Lisp scripting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published