Skip to content

kernelkit/demo

Repository files navigation

Oldschool Demo for Shows etc.

License: MIT Build Status Docker Image Latest Release

A classic demoscene-style demo featuring multiple visual effects with oldschool aesthetics. Built with SDL2 and inspired by 1990s Amiga/PC demos.

Demo Screenshot

Features

Visual Effects

The demo includes 9 different scenes that cycle automatically:

  • Starfield — 3D star field with rotating textured Jack sphere, periodic particle bursts, and burning logo effects
  • Plasma — Colorful plasma effect with animated gradients
  • Rotating Cube — Texture-mapped 3D cube with copper bars background
  • Tunnel — Psychedelic texture-mapped tunnel effect
  • Bouncing Logo — Physics-based bouncing and rotating logo
  • Raining Logo — Multiple logos falling with physics
  • 3D Star Ball — Fibonacci sphere with rotating dots
  • Checkered Floor — Classic perspective floor with bouncing starball
  • Rotozoomer — Rotating and zooming texture effect

Text Scrollers

Multiple scroller styles with smooth effects:

  • Classic — Traditional bottom scroller
  • Sine Wave — Undulating wave motion
  • 3D Roller — Perspective roller with configurable outline/glow effects
  • Bounce — Bouncing text with squash/stretch

Interactive Features

  • Dynamic scroll text with control codes for speed, color, style changes, and pauses
  • Command-line options for fullscreen, window size, scene selection, and duration
  • Custom scroll text loading from files
  • Embedded MOD tracker music playback
  • Configurable roller text effects (4 visual modes)

Quick Start

Download and Run (Easiest)

Download the latest AppImage for your architecture:

x86_64 (Intel/AMD):

wget https://github.com/kernelkit/demo/releases/latest/download/InfixDemo-x86_64.AppImage
chmod +x InfixDemo-x86_64.AppImage
./InfixDemo-x86_64.AppImage

aarch64 (ARM64):

wget https://github.com/kernelkit/demo/releases/latest/download/InfixDemo-aarch64.AppImage
chmod +x InfixDemo-aarch64.AppImage
./InfixDemo-aarch64.AppImage

No installation required! The AppImage bundles all dependencies.

Run with Docker

The container image automatically detects whether X11 is available and adapts accordingly.

On Desktop Systems (with X11)

Basic run:

# Allow X11 connections (run once per session)
xhost +local:docker

# Run the demo
docker run --rm -it \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  ghcr.io/kernelkit/demo:latest

With audio support (PulseAudio/PipeWire):

xhost +local:docker
docker run --rm -it \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  -e SDL_AUDIODRIVER=pulseaudio \
  -e PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native \
  -v ${XDG_RUNTIME_DIR}/pulse/native:${XDG_RUNTIME_DIR}/pulse/native \
  ghcr.io/kernelkit/demo:latest

With specific window size:

# Useful if container detects wrong screen dimensions
docker run --rm -it \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  -e SDL_AUDIODRIVER=pulseaudio \
  -e PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native \
  -v ${XDG_RUNTIME_DIR}/pulse/native:${XDG_RUNTIME_DIR}/pulse/native \
  ghcr.io/kernelkit/demo:latest \
  /app/start.sh -w 1920x1080

On Embedded Systems (without X11)

For embedded systems like Raspberry Pi or Infix OS, the container starts its own X server:

Raspberry Pi 4 / Embedded Linux (fullscreen):

docker run --rm -it \
  --privileged \
  -v /dev/fb0:/dev/fb0 \
  -v /dev/tty1:/dev/tty1 \
  ghcr.io/kernelkit/demo:latest

With custom demo options:

# Example: 30 seconds per scene, show scenes 0, 2, and 6
docker run --rm -it \
  --privileged \
  -v /dev/fb0:/dev/fb0 \
  -v /dev/tty1:/dev/tty1 \
  ghcr.io/kernelkit/demo:latest \
  /app/start.sh -d 30 0 2 6

With display rotation (e.g., RPi 7" touchscreen):

# Rotate display 180 degrees
docker run --rm -it \
  --privileged \
  -v /dev/fb0:/dev/fb0 \
  -v /dev/tty1:/dev/tty1 \
  -e DISPLAY_ROTATE=inverted \
  ghcr.io/kernelkit/demo:latest

Using docker-compose

docker compose up

Environment Variables

  • DISPLAY_ROTATE - Rotate the display (values: normal, left, right, inverted)
    • normal - 0° (default)
    • left - 90° counter-clockwise
    • right - 90° clockwise
    • inverted - 180° upside down

Notes:

  • The container automatically detects if X11 is available via xdpyinfo
  • With X11: Uses the host's X server
  • Without X11: Starts embedded X server using framebuffer
  • --privileged needed for framebuffer/TTY access on embedded systems
  • Default runs fullscreen (-f flag) when using embedded X server

Building from Source

Dependencies

On Debian/Ubuntu/Mint:

sudo apt install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev

On Fedora/RHEL:

sudo dnf install SDL2-devel SDL2_ttf-devel SDL2_image-devel SDL2_mixer-devel

On Arch:

sudo pacman -S sdl2 sdl2_ttf sdl2_image sdl2_mixer

Build and Run

make
./demo

Build AppImage

make appimage

Creates a portable InfixDemo-<arch>.AppImage file.

Build Docker Image

docker build -t demo .

Command-Line Options

Usage: demo [OPTIONS] [SCENE...]

Display Options:
  -f, --fullscreen   Run in fullscreen mode (scales to display)
  -w, --window WxH   Set window size (e.g., 1920x1080)
  -s, --scale N      Integer scaling (e.g., 2 = 1600x1200)

Playback Options:
  -d, --duration SEC Scene duration in seconds (default: 15)
  -t, --text FILE    Load scroll text from file
  -r, --roller N     Roller effect: 0=all, 1=no outline, 2=clean, 3=color (default: 1)
  -h, --help         Show this help message

Scenes:
  0 - Starfield      3 - Tunnel           6 - 3D Star Ball
  1 - Plasma         4 - Bouncing Logo    7 - Rotozoomer
  2 - Cube           5 - Raining Logo     8 - Checkered Floor

Examples:
  demo -f                    # Fullscreen, auto-cycle scenes
  demo -s 2                  # 2x window size (1600x1200)
  demo -w 1920x1080          # Custom window size
  demo -d 30 2 6             # Show cube & star ball, 30s each
  demo -t /mnt/scroll.txt    # Custom scroll text
  demo -r 2 0                # Clean roller effect, starfield only

Performance Optimization

Resolution Scaling

For lower-powered systems (like Raspberry Pi), you can improve performance by rendering at a lower resolution. SDL2 will automatically scale the output to fullscreen or window size:

# Render at half resolution (960x540) - ~75% performance gain
./demo -f -w 960x540

# Render at 720p instead of 1080p - ~50% performance gain
./demo -f -w 1280x720

# Docker example with performance mode
docker run --rm -it \
  --privileged \
  -v /dev/fb0:/dev/fb0 \
  -v /dev/tty1:/dev/tty1 \
  ghcr.io/kernelkit/demo:latest \
  /app/start.sh -w 960x540

Tips:

  • Lower resolutions reduce CPU/GPU load significantly
  • The demo maintains aspect ratio and visual quality during scaling
  • Try different resolutions to find the best balance for your hardware
  • Embedded systems (RPi4) benefit most from 960x540 or 1280x720

Customizing Scroll Text

Using Custom Text File

Create a text file with your scroll message:

echo "Hello demoscene!    This is my custom scroller..." > myscroll.txt
./demo -t myscroll.txt

Control Codes

The scroll text supports embedded control codes for dynamic effects:

Code Description Example
{PAUSE:seconds} Pause scrolling for N seconds {PAUSE:3}
{SPEED:pixels} Change scroll speed (pixels/sec) {SPEED:100}
{STYLE:name} Switch scroll effect style {STYLE:roller}
{COLOR:r,g,b} Set text color (RGB 0-255) {COLOR:255,0,0}

Available Styles:

  • wave - Sine wave scroller
  • roller - 3D roller scroller with outline and glow
  • classic - Traditional bottom scroller
  • bounce - Bouncing text with squash/stretch

Example scroll.txt:

{SPEED:400}{STYLE:bounce}

Welcome to...   the Demo!{PAUSE:2}
{SPEED:400}

Now scrolling... FAST!{SPEED:800}

{SPEED:400}
{STYLE:roller}Now with 3D roller!      {PAUSE:1.5}

{COLOR:255,0,0}
RED

{COLOR:0,255,0}
GREEN

{COLOR:0,0,255}
BLUE

{COLOR:0,0,0}{STYLE:wave}Back to waves...    Greetings to the demoscene! <3

Note: Use {COLOR:0,0,0} to return to the default rainbow gradient effect.

Adding Custom Music

The demo supports MOD/XM/IT tracker music files:

  1. Download a MOD file from The Mod Archive
  2. Rename it to music.mod
  3. Place it in the project directory
  4. Rebuild: make clean && make

The music will be embedded in the binary.

Development

Project Structure

.
├── demo.c              # Main source code
├── Makefile           # Build system
├── Dockerfile         # Container build
├── utils/
│   └── build-appimage.sh  # AppImage build script
├── .github/
│   └── workflows/
│       └── build.yml  # CI/CD pipeline
├── topaz-8.otf        # Embedded font
├── jack.png           # Texture asset
├── logo.png           # Logo asset
├── infix.png          # Infix logo for fire effect
├── wires.png          # Wires logo for fire effect
├── scroll.txt         # Default scroll text
└── music.mod          # Optional MOD music file

Architecture Support

  • x86_64 (Intel/AMD 64-bit)
  • aarch64 (ARM 64-bit)

Both architectures are built automatically via GitHub Actions and released as AppImages and Docker images.

Assets & Licenses

Code

MIT License - See LICENSE file for details.

Font

The FontStruction Amiga Topaz 8 by nonarkitten is licensed under a Creative Commons Attribution Share Alike license.

Music

The demo includes "Enigma" by Phenomena, licensed under the Mod Archive Distribution license.

Contributing

Contributions are welcome! Feel free to:

  • Report bugs or request features via GitHub Issues
  • Submit pull requests with improvements
  • Share your custom scroll texts and music combinations

Acknowledgments

Inspired by classic Amiga and PC demos from the 1990s demoscene. Special thanks to:

  • The demoscene community for decades of creative inspiration
  • SDL2 developers for the excellent multimedia library
  • Mod Archive for preserving tracker music history
  • Classic demoscene resources at lodev.org

Made with ❤️ for the demoscene