Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flying Toasters — Modern Windows Screensaver

A native Windows screensaver recreating the After Dark "Flying Toasters" animation, rendered on the GPU (Direct3D 11) at the display's refresh rate up to 4K.

See FlyingToasters_SPEC.md for the full engineering spec.

Prerequisites

All present on the reference machine — nothing to install:

  • Visual Studio 2022 or newer (or Build Tools) with the Desktop development with C++ workload (provides MSVC, the Windows SDK, and bundled CMake + Ninja).
  • The build also uses Windows PowerShell + .NET System.Drawing at build time only, to compose the sprite atlas. The shipped .scr has zero third-party dependencies.

Build

.\build.ps1                # Release build -> build\Release\FlyingToasters.scr
.\build.ps1 -Clean         # wipe build\ first
.\build.ps1 -Config Debug  # debug build
.\build.ps1 -Run           # build, then launch windowed debug mode (/w)

The build locates Visual Studio via vswhere, uses the bundled CMake with the matching Visual Studio generator (auto-detected from the installed VS version), regenerates the atlas, compiles, and copies the output to FlyingToasters.scr.

Screensaver command-line contract

Windows invokes the .scr (a Windows-subsystem .exe renamed to .scr) with:

Args Mode Behavior
/s Run Fullscreen across all monitors; exits on mouse move (>4 px), click, or key.
/p <HWND> Preview Renders as a child of the Settings thumbnail; tears down with the host.
/c[:<HWND>] Config Settings dialog (Count, Speed, Toast ratio, Darkness, Color, Starfield, V-sync, Scale, Monitors); persists to HKCU.
/w Debug Resizable windowed mode for development (not used by the OS).
(none) Shows config.

Install

  1. Build, then copy build\Release\FlyingToasters.scr to C:\Windows\System32 (or right-click the .scrInstall).
  2. Pick Flying Toasters in Screen Saver Settings.

Note: an unsigned .scr may trigger SmartScreen if distributed to other machines.

Assets

Original Berkeley Systems sprites (© 1989 Berkeley Systems), pulled from bryanbraun/after-dark-css (color toaster + toast) and BeaVix/FlyingToastersJS (B&W spritesheet). tools/build_atlas.ps1 composes them into a single premultiplied 256×256 atlas (res/atlas.png) embedded in the .scr, and generates the UV/frame table (src/AtlasTable.generated.h). Both are build artifacts (git-ignored). Kept as a single swappable resource so the artwork can be replaced without code changes. Chosen for personal use per the spec's IP note.

Repository layout

FlyingToasters/
  CMakeLists.txt        build definition
  build.ps1             one-command build wrapper
  FlyingToasters_SPEC.md
  src/
    main.cpp            arg parse + mode dispatch + window scaffolding
    Renderer.h/.cpp     D3D11 device, swap chain, pacing, sprite pipeline
    Scene.h/.cpp        headless simulation: spawn/motion/recycle, tiers, flap, toast
    Settings.h/.cpp     HKCU registry load/save + clamp + Settings→SceneConfig
    ConfigDialog.h/.cpp /c modal dialog (trackbars, checkboxes, combos)
    Sprite.h            SpriteInstance POD (shared with the Scene, no D3D types)
    SpriteAtlas.h/.cpp  WIC decode of the embedded atlas PNG
    shaders/sprite.hlsl instanced VS+PS (embedded as RCDATA, compiled at runtime)
    AtlasTable.generated.h   (generated) UV/frame table
  res/
    resources.rc        embeds atlas + sprite shader + dialog + manifest + version info
    app.manifest        PerMonitorV2 DPI, Win10/11 compat, v6 common controls
    atlas.png           (generated)
  tools/
    build_atlas.ps1     GIF -> premultiplied atlas + UV table
  assets/raw/           source GIF/PNG sprites
  tests/
    scene_tests.cpp     headless Scene tests (no GPU; run via build\<cfg>\scene_tests.exe)

About

Modern Windows Flying Toasters screensaver (C++17 / Direct3D 11)

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages