Creative Coding Framework for C++

Thin, Modern, and Native.

Inspired by openFrameworks.
Built for modern GPUs.

MIT License C++20 Metal / DX12 / Vulkan

Philosophy

A new foundation (Truss) for the next decade

Minimal Footprint

Carefully selected features keep binary size tiny. Lightning-fast compilation and lightweight executables.

GPL-Free

Built for commercial use with MIT / zlib / Public Domain licenses only. No GPL contamination risk.

No Black Box

A thin abstraction layer that exposes native APIs. Direct access to Metal / DX12 / Vulkan when you need it.

Simple & Intuitive

One line of code, instant visuals. The magic remains.

tcApp.cpp
#include "tcApp.h"

void tcApp::setup() {
    // Set loop mode
    setLoopMode(LoopMode::Game);

    // Load an image
    image = make_shared<Texture>("test.png");
}

void tcApp::update() {
    angle += 1.0f;
}

void tcApp::draw() {
    clear(0.1f, 0.1f, 0.1f);

    pushMatrix();
    translate(640, 360);
    rotate(angle);
    image->draw(-50, -50, 100, 100);
    popMatrix();
}
main.cpp
#include "TrussC.h"
#include "tcApp.h"

// Define backend implementation
#define SOKOL_IMPL
#include "sokol_app.h"

// That's it!
TC_MAIN(tcApp)

Tech Stack

A hybrid of custom implementations and high-quality lightweight libraries

Core

sokol_app

Window, input & context management

zlib
Graphics

sokol_gfx

Metal / DX12 / Vulkan backend

zlib
Scene

Node System

Scene graph & event propagation

Custom
Math

C++20 Template

Vector & matrix operations

Public Domain
Image

stb_image

Image loading & saving

Public Domain
Font

stb_truetype

Font rendering

Public Domain
Audio

sokol_audio + dr_libs

Audio I/O & file playback

zlib / PD
Video

Native Wrapper

AVFoundation / Media Foundation

Custom

For oF Users

Built on the joy of creative coding that openFrameworks pioneered

TrussC deeply respects the magical "one line of code, instant visuals" experience that oF created.
If you know oF, you'll feel right at home.

Feature openFrameworks TrussC
Lifecycle setup, update, draw setup, update, draw Same
Immediate Drawing ofDrawCircle(x, y, r) drawCircle(x, y, r) Same
State Management ofSetColor, ofPushMatrix setColor, pushMatrix Same
Coordinate System Global coordinates Scene graph + local coordinates
Graphics Backend OpenGL Metal / DX12 / Vulkan
Memory Management ofPtr / raw pointers std::shared_ptr
Delayed Execution ofThread / DIY callAfter, callEvery (sync timers)

What TrussC Offers

Commercial-Friendly

MIT / zlib / Public Domain only. No GPL concerns.

Built-in Scene Graph

Node-based hierarchy. Easy hit testing even on rotated elements.

Local Coordinate Events

Mouse coordinates auto-transformed to each node's local space.

Safe Sync Timers

callAfter / callEvery for safe main-thread delayed execution.

Blazing Fast Builds

Minimal dependencies mean fast compile times and tiny binaries.

Native GPU Support

Metal / DirectX 12 / Vulkan for maximum hardware performance.

Get Started

Up and running in 3 steps

1

Clone the repository

git clone https://github.com/TrussC-org/TrussC.git
2

Build with CMake

cd TrussC && mkdir build && cd build
cmake .. && make
3

Run an example

./examples/hello_world