Acacia

A small game engine in C++ for Windows that draws every pixel itself: no OpenGL, no DirectX, just its own software renderer.

GET IT ON GITHUB
Acacia's 3D demo: a forested procedural island in a blue sea under a daytime sky
The 3D demo: fly over a procedural island with trees, water, fog and baked sun shadows.

Software renderer

Triangles are clipped, rasterised and depth-tested on the CPU, then shown with GDI. 2D rectangles and 3D meshes share one frame buffer.

Procedural islands

Fractal value noise with an island falloff; sand, grass, forest, rock and snow by height and slope; cone trees and a sea. Press R for a new seed.

Sun and sky

Move the sun from dawn to night; sky, fog and ambient light follow it, shadows are re-baked, and F lights a torch.

2D scene

Entities with update callbacks, a fixed 60 Hz game loop and keyboard input. Tab switches between the 2D and 3D demos.

Acacia's 2D demo: a green player square among bouncing orange and yellow blocks
The 2D demo: steer the green square, the blocks bounce off the edges.

Controls (3D)

W A S Dfly
Q / Edown / up
Arrows or right mouselook around
Shiftfly faster
Z / Xmove the sun
Ftorch
Rnew island
Tab2D / 3D demo
Escquit

Build it

Open acacia.sln in Visual Studio 2022 (C++17, Desktop development with C++) and press F5, or from a Developer Command Prompt:

msbuild acacia.vcxproj -p:Configuration=Release -p:Platform=x64
QR code to this page