Creative Coding Framework for C++

TrussC

Post-OpenGL Creative Coding.
Built on sokol.

MIT License C++20 Metal / DX12 / Vulkan

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 += TAU * 0.005f;
}

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)

Design

Concrete choices, not abstract principles

Modern Graphics

sokol_gfx powers Metal, DX12, and Vulkan. No OpenGL dependency.

GPL-Free

MIT / zlib / Public Domain only. No FFmpeg—video uses AVFoundation & Media Foundation.

Cross-Platform

macOS, Windows, Linux, and Web. iOS planned.

Friendly

Tools and resources to help you get started

Project Generator

GUI tool to create new projects and manage addons. No command line required.

Ask AI

Got questions? Our AI assistant knows TrussC inside and out. Try it →

50+ Examples

Graphics, sound, video, networking, and more. Run them in your browser →

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