JP - Flintlock

flintlock

the development of flintlock

about

Flintlock is a 2D renderer (for now) and game engine written in Rust. The goal is to have a fully functional 2D renderer + level editor that has an embedded scripting language and can bundle and ship a 2D game. It's open-source: the repository can be found here.

The project itself borrows heavily from both the Vulkano documentation and GitHub user taidaesal's Vulkano tutorial.

I'll document my process and progress here and what I'd like the API to look like in the future. I'll also document how the components of the system work and the technologies used to build them.

the journey

After a few iterations, I landed on a project structure: the Application struct handles events and owns an instance of the Renderer struct, which it makes render calls to. The renderer must be primed with renderer.start(), then renderer.draw() must be called and provided a triangle or quad that implements the Renderable trait (or color_draw() and ColorRenderable for non-textured primitives). After this, each lighting pass must be explicitly called: following draw calls, renderer.ambient(), renderer.directional(), and renderer.point() must be called, and directional() and point() must be provided a DirecionalLight and PointLight, respectively.

The obvious choice for graphics API was Vulkan, since it provides a great modern abstraction for GPUs and platform agnosticism. However, it comes with a much more verbose API and initialization. The basics (in pseudocode) go something like this:

    
  

This skips over a lot of details, but it's generally correct. After this initialization, rendering really isn't too hard.


This is still under construction. Come back soon!