Skip to main content
The SDK ships three sample projects inside sdk/samples/. Each sample is a self-contained CMake project that demonstrates a different level of engine integration — from a minimal render loop all the way to a feature-complete voxel game starter. You can build and run them directly against a local engine build or a prebuilt SDK, and you can copy any sample as a starting point for your own game.

Sample overview

BasicTriangle

Minimal runnable app. Covers window creation, platform initialization, and a frame loop with BeginFrame / EndFrame / Present.

BlockGame

Game logic patterns. Covers input handling, simple world generation, player movement, AABB collision detection, and block placement.

PrismaCraftStarter

Voxel/craft game starter. Integrates PrismaEngine with the PrismaCraft library for chunk loading, full block registration, terrain generation, and a basic inventory system.

BasicTriangle

BasicTriangle is the smallest complete application you can write with PrismaEngine. It creates a window, initializes the render system, and runs a frame loop until the user closes the window. No game logic, no assets — just the engine lifecycle in its most direct form.

Build commands

1

Build against a local engine build

Point PrismaEngine_DIR at your engine build output directory.
2

Build against a prebuilt SDK

Point PrismaEngine_DIR at the root of an extracted SDK archive.

Full source: main.cpp

The complete source file for BasicTriangle demonstrates the canonical IApplication<T> pattern. All three lifecycle methods — Initialize(), Run(), and Shutdown() — must be implemented. The LOG_INFO and LOG_ERROR macros write to the engine’s thread-safe logger.
IApplication<T> uses CRTP (Curiously Recurring Template Pattern). Your concrete class is the template argument. SetRunning(bool) and IsRunning() are inherited from the base class and control the main loop state.

BlockGame

BlockGame demonstrates how to build game logic on top of PrismaEngine. It covers the patterns you need for any action game: a fixed-timestep game loop, keyboard and mouse input, a simple voxel world, player physics with AABB collision detection, and block placement and destruction.

What it covers

Code structure

Build commands

Run on Linux:
Run on Windows:
BlockGame links against both PrismaEngine::Engine and PrismaCraft::PrismaCraft. Make sure PrismaCraft_DIR is also set if you are building against a local PrismaCraft installation.

Controls

PrismaCraftStarter

PrismaCraftStarter is a full voxel game starter that combines PrismaEngine with the PrismaCraft library. It targets developers who want a Minecraft-style foundation with chunk loading, a complete block registry, terrain generation, and a basic inventory — ready to extend without building those systems from scratch.

How it differs from BlockGame

Build commands

Project structure

Using samples as project templates

Each sample is a self-contained CMake project. To use one as a starting point for your own game:
1

Copy the sample directory

Copy the sample you want to use into a new directory outside the SDK.
2

Update the project name

Open CMakeLists.txt and replace the project() name and add_executable target name with your game’s name.
3

Point CMake at your SDK

Configure with PrismaEngine_DIR set to your SDK location.
4

Rename the application class

In src/main.cpp, rename the IApplication<T> subclass and update the template argument to match your new class name, then start adding your game logic.
Start with BasicTriangle if you are new to PrismaEngine — it has the smallest surface area and makes the IApplication<T> lifecycle easy to follow. Move to BlockGame once you need input handling and world state, or jump straight to PrismaCraftStarter if your target genre is voxel / sandbox.