Skip to content
简体中文

Introduction & Installation

Emacs GFX (egfx) is an independent, modern native graphics engine and OS child-view container host for stock GNU Emacs 29.1+.

Every package in this organization requires only stock GNU Emacs 29.1+ with zero external UI framework dependencies and zero OpenGL. Native rendering runs exclusively on each operating system’s modern graphics stack:

Platform Native GPU Pipeline Text & Image Engine Native Browser Engine (egfx-browser)
macOS Cocoa + Metal (CAMetalLayer) CoreText + ImageIO (sRGB) WKWebView (WebKit.framework)
Windows Direct3D 11 + DXGI Flip Model + DirectComposition DirectWrite + Direct2D + WIC Edge WebView2 (pure C COM)
Linux Vulkan 1.0+ WSI (X11 / Wayland, GTK4 & GTK3) Runtime dlopen Pango / Cairo / GdkPixbuf WebKitGTK (runtime dlopen)

Development takes place in the emacs-gfx/emacs-gfx monorepo and projects automatically to five read-only standalone repositories:

  • egfx: Pure-Elisp 60 FPS GPU canvas (egfx-canvas), retained native SDF scene engine (egfx-scene-apply), floating child-frame occlusion hole-punching, relative Pointer Lock, native Gamepad, < 1 ms OS pipe events, versioned C Provider ABI (egfx_abi.h v3), and 1-click prebuilt module downloader (egfx-install-native).
  • egfx-audio: Zero-dependency OS-native streaming PCM & 32-voice BGM/SFX audio mixer (CoreAudio, WinMM, PulseAudio).
  • egfx-wgpu: Zero-copy Rust wgpu direct-GPU provider with WGSL shader hot-reload, PNG textures, 16K instanced 2D Sprite Batch, 3D depth mesh pipeline, non-blocking presentation, and CRT/Bloom/Vignette Post-FX.
  • egfx-browser: Cross-platform native GUI web browser mounted inside Emacs windows via egfx’s GPU-less native container host.

All five layered game packages project together into emacs-gfx/egfx-games:

  • egfx-game (L1): 60 Hz 2D GPU game framework (zero-allocation Sprite Batcher, Sprite Atlases, Tiled .tmj tilemaps, collisions, particles, JSON saves, live-coding hot-reload, M-x egfx-new-game), shared modal controls & arrow-first keybinding manager (K), and built-in 3-world pixel platformer Starlight Meadow.
  • egfx-retro (L2): Native Libretro console host (mGBA, Snes9x, FCEUmm, TIC-80, WASM-4, 2048) with 1-click core/game installer (Celeste Classic, Apotris), 4-port Gamepad, TIFF save thumbnails, and rewind.
  • egfx-doom (L2): Native C 3D DOOM / Freedoom FPS host with Pointer Lock mouse turning, Gamepad, 16-channel DMX digital SFX, and 1-click Freedoom WAD download.
  • egfx-bevy (L2): Zero-copy Rust Bevy 0.15 ECS 3D host linking egfx-wgpu-core with a live Emacs ECS entity inspector.
  • egfx-arcade (L3): EGFX ARCADE unified GPU cover-wall launcher with integrated 62 px GPU top navigation bar, category filters, instant search, favorites, built-in WebGL2/WASM runner (over optional egfx-browser with pure-Elisp COOP/COEP localhost server), and global mute/hide.

Emacs GFX has zero dependency on ETAF. It is built for all Emacs users (stock Emacs, Doom Emacs, Spacemacs, Org-mode workflows, and custom packages). ETAF optionally consumes egfx when present on load-path for GPU-accelerated canvas widgets, hardware video overlays, and real-time game rendering.

Clone the monorepo (recommended for development) or individual standalone repositories:

Terminal window
git clone https://github.com/emacs-gfx/emacs-gfx.git
cd emacs-gfx
make native
make check

Add the packages to your Emacs init.el:

(add-to-list 'load-path "/path/to/emacs-gfx/packages/egfx")
(add-to-list 'load-path "/path/to/emacs-gfx/apps/egfx-browser")
(require 'egfx)
(require 'egfx-browser)
  • macOS: Xcode Command Line Tools (Metal.framework, CoreText, WebKit.framework ship with macOS).
  • Linux: C11 compiler (gcc or clang) and Emacs 29.1+ headers. Vulkan, Pango, GdkPixbuf, and WebKitGTK are loaded dynamically via dlopen at runtime — no -dev graphics headers are required.
  • Windows: MinGW-w64 gcc and Edge WebView2 Runtime (preinstalled on Windows 10/11).

Inside GUI Emacs, run:

M-x egfx-doctor
M-x egfx-browser-doctor

Both commands inspect GPU acceleration, display scale factor, < 1 ms OS pipe wakeup, and dynamic module availability.