|
1 | | -//! Metal Renderer with Overlay UI |
| 1 | +//! Full Metal Application |
2 | 2 | //! |
3 | | -//! A real GUI application demonstrating: |
4 | | -//! - Metal rendering with compiled shaders |
5 | | -//! - Screen capture via `ScreenCaptureKit` with zero-copy `IOSurface` textures |
6 | | -//! - System content picker (macOS 14.0+) for user-selected capture |
7 | | -//! - Interactive overlay menu with bitmap font rendering |
8 | | -//! - Real-time audio waveform visualization with vertical gain meters |
9 | | -//! - Screenshot capture (macOS 14.0+) |
10 | | -//! - Video recording (macOS 15.0+) |
| 3 | +//! A complete macOS application demonstrating the full ScreenCaptureKit API: |
| 4 | +//! |
| 5 | +//! - **Metal GPU Rendering** - Hardware-accelerated graphics with runtime shader compilation |
| 6 | +//! - **Screen Capture** - Real-time display/window capture via ScreenCaptureKit |
| 7 | +//! - **Content Picker** - System UI for selecting capture source (macOS 14.0+) |
| 8 | +//! - **Audio Visualization** - Real-time waveform display with VU meters |
| 9 | +//! - **Screenshot Capture** - Single-frame capture with HDR support (macOS 14.0+/26.0+) |
| 10 | +//! - **Video Recording** - Direct-to-file recording (macOS 15.0+) |
| 11 | +//! - **Microphone Capture** - Audio input with device selection (macOS 15.0+) |
| 12 | +//! - **Bitmap Font Rendering** - Custom 8x8 pixel glyph overlay text |
| 13 | +//! - **Interactive Menu** - Keyboard-navigable settings UI |
| 14 | +//! |
| 15 | +//! ## Running |
| 16 | +//! |
| 17 | +//! ```bash |
| 18 | +//! # Basic (macOS 14.0+) |
| 19 | +//! cargo run --example 16_full_metal_app --features macos_14_0 |
| 20 | +//! |
| 21 | +//! # With recording support (macOS 15.0+) |
| 22 | +//! cargo run --example 16_full_metal_app --features macos_15_0 |
| 23 | +//! |
| 24 | +//! # With HDR screenshots (macOS 26.0+) |
| 25 | +//! cargo run --example 16_full_metal_app --features macos_26_0 |
| 26 | +//! ``` |
11 | 27 | //! |
12 | 28 | //! ## Controls |
13 | 29 | //! |
14 | | -//! Menu navigation (when menu visible): |
15 | | -//! - `UP/DOWN` - Navigate menu items |
| 30 | +//! **Menu Navigation** (when menu visible): |
| 31 | +//! - `↑`/`↓` - Navigate menu items |
| 32 | +//! - `Space`/`Enter` - Select item |
| 33 | +//! - `Esc`/`H` - Hide menu |
| 34 | +//! |
| 35 | +//! **Direct Controls** (when menu hidden): |
| 36 | +//! - `P` - Open content picker |
| 37 | +//! - `Space` - Start/stop capture |
| 38 | +//! - `S` - Take screenshot |
| 39 | +//! - `R` - Start/stop recording (macOS 15.0+) |
| 40 | +//! - `W` - Toggle waveform display |
| 41 | +//! - `M` - Toggle microphone |
| 42 | +//! - `C` - Open config menu |
| 43 | +//! - `H` - Show menu |
| 44 | +//! - `Q`/`Esc` - Quit |
16 | 45 |
|
17 | 46 | #![allow( |
18 | 47 | clippy::too_many_lines, |
|
21 | 50 | clippy::cast_sign_loss, |
22 | 51 | clippy::cast_possible_truncation |
23 | 52 | )] |
24 | | -//! - `SPACE/ENTER` - Select item |
25 | | -//! - `ESC/H` - Hide menu |
26 | | -//! |
27 | | -//! Direct controls (when menu hidden): |
28 | | -//! - `P` - Open content picker |
29 | | -//! - `SPACE` - Start/stop capture |
30 | | -//! - `S` - Take screenshot (when source selected) |
31 | | -//! - `R` - Start/stop recording (macOS 15.0+, requires active capture) |
32 | | -//! - `W` - Toggle waveform display |
33 | | -//! - `C` - Open config menu |
34 | | -//! - `M` - Toggle microphone |
35 | | -//! - `H` - Show menu |
36 | | -//! - `Q/ESC` - Quit |
37 | | -//! |
38 | | -//! ## Run |
39 | | -//! |
40 | | -//! ```bash |
41 | | -//! cargo run --example 16_metal_overlay --features macos_14_0 |
42 | | -//! ``` |
43 | 53 |
|
44 | 54 | mod capture; |
45 | 55 | mod font; |
|
0 commit comments