Build & Compile
Free Eggbert supports multiple build systems and targets. The recommended approach is CMake with the FreeDirect backend.
CMake (Recommended — Cross-platform)
The canonical cross-platform build uses the Free Direct backend, which replaces DirectDraw/DirectSound with SDL3-based equivalents.
Configure and Build
# 1. Initialize submodules
git submodule update --init --recursive
# 2. Configure
cmake -S . -B build -DSPEEDY_BLUPI_BACKEND=FREEDIRECT
# 3. Build
cmake --build build -j
System SDL Override (Advanced)
If you prefer to use system-installed SDL packages instead of the vendored submodules:
cmake -S . -B build -DSPEEDY_BLUPI_BACKEND=FREEDIRECT -DFREE_USE_SYSTEM_SDL=ON
FREE_USE_SYSTEM_SDL=ON requires compatible SDL3, SDL3_image, and SDL3_mixer
packages to be installed system-wide. The default vendored build is preferred.
Dependency Boundaries
The intended dependency chain is strictly layered:
Free Eggbert game code
↓
Free API / Free Direct public compatibility headers
↓
Free API / Free Direct implementation
↓
SDL3 / SDL_image / SDL_mixer internals
SPEEDY_BLUPI_WINDOWSlinks onlyfree-apiandfree-direct- SDL include directories and libraries stay private to
free-api/free-direct - No game source file should include SDL headers directly
Non-MSVC Compiler Options
Because the codebase originates from decompiled code, it uses constructs that modern C++ compilers reject by default. The following permissive flags are applied:
| Flag | Purpose |
|---|---|
-fpermissive | Allow constructs rejected by strict C++ |
-fms-extensions | Enable Microsoft extensions |
-fPIC | Position-independent code |
-w | Suppress all warnings |
-Wno-narrowing | Allow narrowing conversions |
-Wno-int-to-pointer-cast | Allow int-to-pointer casts |
-g | Generate debug symbols |
-O0 | No optimization (easier debugging) |
Visual Studio 2022 (Windows, Native DirectX)
For building against the original DirectX 3 SDK on Windows:
- Open
Speedy Eggbert 2 Source.slnin Visual Studio 2022 - Set the platform to x86
- Set the debugger target to Win32
- Open Project Properties → C/C++ → Command Line → Additional Options
Add:/wd4700 /wd4703 - Open Project Properties → General → Platform Toolset
Set to: Visual Studio 2022 (v143) - Right-click the solution → Build Solution
Known Workaround for COM Header Error
On some Windows SDK versions, you may encounter:
c:\program files (x86)\windows kits\8.1\include\um\combaseapi.h(229):
error C2760: syntax error: unexpected token 'identifier', expected 'type specifier'
The workaround is to add this before the problematic include:
typedef struct IUnknown IUnknown;
WebAssembly (Emscripten)
Free Eggbert can be compiled to WebAssembly for running in a browser.
Setup
First, install and activate the Emscripten SDK:
source /path/to/emsdk/emsdk_env.sh
Build and Run
# Configure for WebAssembly
emcmake cmake -S . -B cmake-build-web -DCMAKE_BUILD_TYPE=Debug
# Build
cmake --build cmake-build-web -j
# Run in browser (starts local HTTP server)
emrun cmake-build-web/bin/SPEEDY_BLUPI_WINDOWS.html
Game assets from gamefiles/ (DATA, IMAGE08, IMAGE16, SOUND) are
preloaded into the Emscripten virtual filesystem at build time —
no manual copying is required.
Persistent Saves on Web
Save data is stored in IndexedDB via Emscripten's IDBFS,
mounted at /save inside the virtual filesystem.
Data persists across page reloads. Clearing browser site data resets to defaults.
// Export /save to IndexedDB (from browser console)
Module.ccall('FreeEggbert_ExportPersistentData', null, [], []);
// Restore /save from IndexedDB
Module.ccall('FreeEggbert_ImportPersistentData', null, [], []);
These functions are defined in src/web_persistence.cpp and exported
via EMSCRIPTEN_KEEPALIVE. On non-Emscripten builds, the file is empty.
Android (NDK + Gradle)
See Platform Support → Android for the full Android build guide.
CMake with Visual Studio Generator
When using CMake with the Visual Studio generator on Windows:
git submodule update --init --recursive
cmake -S . -B build -G "Visual Studio 17 2022" -DSPEEDY_BLUPI_BACKEND=FREEDIRECT
cmake --build build --config Debug
Build TODO Items
- Clean checkout builds without system SDL packages on Linux
FREE_USE_SYSTEM_SDL=ONstill works as an overridefree-apiandfree-directlink SDL asPRIVATE(notPUBLIC)- No game source file contains direct SDL usage (
#include <SDL...>) - Whether
/permissive-is appropriate for decompiled MSVC code