https://github.com/cppcoffee/gpui-demo
macOS GPUI demo
https://github.com/cppcoffee/gpui-demo
Last synced: 6 days ago
JSON representation
macOS GPUI demo
- Host: GitHub
- URL: https://github.com/cppcoffee/gpui-demo
- Owner: cppcoffee
- Created: 2026-04-26T13:56:54.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-04-27T12:40:20.000Z (about 1 month ago)
- Last Synced: 2026-04-27T14:26:22.880Z (about 1 month ago)
- Language: Rust
- Homepage:
- Size: 264 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GPUI Demo
A minimal Rust + Metal UI demo inspired by Zed's GPUI architecture.

## Overview
This demo opens a macOS window with a GPU-rendered button and FPS overlay. It shows the core UI flow used by GPUI-style systems:
```text
Element Tree -> Layout -> Prepaint -> Paint -> Scene -> Metal Renderer
```
## Highlights
- Metal instanced quad rendering
- SDF rounded rectangles and borders
- Simple flexbox-style layout
- Interactive button hover and press states
- VSync-driven render loop with `CVDisplayLink`
- Small module structure modeled after Zed GPUI concepts
## Run
Requires macOS with Metal support.
```bash
cargo run
```
## Main Modules
- `element`, `div`, `button`, `text` - UI elements
- `layout`, `style`, `geometry` - layout and styling primitives
- `scene`, `renderer`, `shaders` - rendering pipeline
- `metal_view`, `display_link` - macOS window and render loop