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.
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))
- Window management
- Drawing sprites
- Coordinate system
- Scripting Integration
- Multiplatform development
- Camera System
- Basic Lighting
- Model loading
- Sprite transparency
- Bitmap text rendering
- Playimg audio
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.
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
- #1 - Thinking of adding Lisp to my custom game engine
- #2 - Implemented basic Scheme scripting for Rebel Game Engine
- #3 - Rebel Game Engine now works on different platforms
- #4 - Following Lispy conventions
- #5 - Switching from C/C++ to C
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.