Creative Coding Framework for C++
Inspired by openFrameworks.
Built for modern GPUs.
A new foundation (Truss) for the next decade
Carefully selected features keep binary size tiny. Lightning-fast compilation and lightweight executables.
Built for commercial use with MIT / zlib / Public Domain licenses only. No GPL contamination risk.
A thin abstraction layer that exposes native APIs. Direct access to Metal / DX12 / Vulkan when you need it.
One line of code, instant visuals. The magic remains.
#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();
}
#include "TrussC.h"
#include "tcApp.h"
// Define backend implementation
#define SOKOL_IMPL
#include "sokol_app.h"
// That's it!
TC_MAIN(tcApp)
A hybrid of custom implementations and high-quality lightweight libraries
Window, input & context management
zlibMetal / DX12 / Vulkan backend
zlibScene graph & event propagation
CustomVector & matrix operations
Public DomainImage loading & saving
Public DomainFont rendering
Public DomainAudio I/O & file playback
zlib / PDAVFoundation / Media Foundation
CustomBuilt 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) |
MIT / zlib / Public Domain only. No GPL concerns.
Node-based hierarchy. Easy hit testing even on rotated elements.
Mouse coordinates auto-transformed to each node's local space.
callAfter / callEvery for safe main-thread delayed execution.
Minimal dependencies mean fast compile times and tiny binaries.
Metal / DirectX 12 / Vulkan for maximum hardware performance.
Up and running in 3 steps
git clone https://github.com/TrussC-org/TrussC.git
cd TrussC && mkdir build && cd build
cmake .. && make
./examples/hello_world