🐣 Mobile Eggbert

Build System

Mobile Eggbert uses CMake 3.21+ as its build system. All four target platforms share the same CMakeLists.txt; platform-specific behaviour is enabled through CMake flags.

Prerequisites

ToolPurposeMinimum Version
CMakeBuild system generator3.21
GCC or ClangC++23 compiler (Linux/macOS)GCC 13 / Clang 16
MinGW-w64Windows cross-compilation from Linuxx86_64-w64-mingw32
Emscripten SDKWebAssembly build3.1+
Android NDKAndroid native build28.2.13676358
GradleAndroid APK packaging8.4+
SDL3Window, input, rendering (via CNA)3.x
SDL3_imagePNG loading (via CNA)3.x
SDL3_mixerAudio mixing (via CNA)3.x

Initialize Submodules

CNA and SharpRuntime are Git submodules. Run this once after cloning:

git submodule update --init --recursive

Linux Build

The recommended development target. Uses the EasyGL (OpenGL) backend by default.

# Configure
cmake -S . -B cmake-build-debug \
  -DCMAKE_BUILD_TYPE=Debug

# Build
cmake --build cmake-build-debug --target WindowsPhoneSpeedyBlupi

# Run
./cmake-build-debug/WindowsPhoneSpeedyBlupi

To explicitly choose the SDL_Renderer backend:

cmake -S . -B build-linux \
  -DCNA_BACKEND_SDL_RENDERER=ON \
  -DCNA_BACKEND_EASY_GL=OFF \
  -DCNA_BACKEND_BGFX=OFF
cmake --build build-linux --target WindowsPhoneSpeedyBlupi

Rendering Backends

Exactly one rendering backend must be active at build time. Set via CMake flags:

CMake FlagBackendRecommended For
CNA_BACKEND_EASY_GL=ONeasy-gl (lightweight OpenGL)Desktop (default)
CNA_BACKEND_SDL_RENDERER=ONSDL_RendererEmscripten, Android, compatibility
CNA_BACKEND_BGFX=ONbgfx (multi-API)Desktop, multi-GPU
VulkanVulkanDesktop high-performance build
Default Desktop Backend The current default for desktop builds is EasyGL. If you want the Vulkan build, use the cmake-build-vulkan preset.

Web / Emscripten Build

Produces a .html + .wasm + .js bundle that runs in any modern browser.

# Activate Emscripten SDK (adjust path)
source /path/to/emsdk/emsdk_env.sh

# Configure with Emscripten cmake wrapper
emcmake cmake -S . -B cmake-build-web -DCMAKE_BUILD_TYPE=Debug

# Build
cmake --build cmake-build-web

# Run in browser (starts a local HTTP server)
emrun cmake-build-web/WindowsPhoneSpeedyBlupi.html

Emscripten-specific Settings

These flags are automatically set by CMakeLists.txt when building for Emscripten:

Linker FlagValueEffect
ALLOW_MEMORY_GROWTH1Heap can grow dynamically at runtime
INITIAL_MEMORY134 MBStarting heap allocation
--preload-file ContentGame assets embedded in .data file
--preload-file worldsLevel files embedded

Virtual filesystem mount points accessible from C++ code:

  • /Content/backgrounds/ — level backgrounds
  • /Content/icons/ — sprite sheets
  • /Content/sounds/ — WAV files
  • /worlds/ — level text files
Web Sound Delay The Emscripten build has a known audio startup delay on first sound playback. This is a known issue under investigation. See Known Issues.

Android Build

The android/ directory contains a Gradle project that wraps the native build.

cd android
./gradlew assembleDebug

# Install to connected device or emulator
adb install app/build/outputs/apk/debug/app-debug.apk

# Launch
adb shell am start -n org.openeggbert.speedyblupi/.SpeedyBlupiActivity

Android Configuration

SettingValue
NDK version28.2.13676358
Target API level35 (Android 15)
Asset accessAAssetManager (assets packaged in APK)
Rendering backendSDL_Renderer (auto-selected for Android)

Windows Build (Cross-compile from Linux)

Uses MinGW-w64 to produce a native Windows x86_64 executable. See WINDOWS.md in the repo root for full details.

cmake -S . -B cmake-build-win \
  -DCMAKE_TOOLCHAIN_FILE=cmake/mingw-toolchain.cmake \
  -DCMAKE_BUILD_TYPE=Release
cmake --build cmake-build-win --target WindowsPhoneSpeedyBlupi

The C++ runtime can be linked either dynamically (default) or statically via -static-libgcc -static-libstdc++.

Asset Layout per Platform

PlatformContent locationHow accessed
Linux / WindowsContent/ copied next to executableStandard file I/O
EmscriptenPreloaded into virtual FS at link time/Content/ virtual path
AndroidPackaged as APK assetsAAssetManager API

Runtime DLLs (Windows only)

The following DLLs must be present alongside the executable on Windows (CMake copies them automatically):

  • SDL3.dll
  • SDL3_image.dll
  • SDL3_mixer.dll
  • libwinpthread-1.dll

Alternatively, link statically with -static-libgcc -static-libstdc++ to avoid the libwinpthread dependency.