| Crates.io | blinc_app |
| lib.rs | blinc_app |
| version | 0.1.12 |
| created_at | 2026-01-14 19:18:07.398749+00 |
| updated_at | 2026-01-19 01:08:48.985164+00 |
| description | Blinc application framework with clean layout and rendering API |
| homepage | |
| repository | https://github.com/project-blinc/Blinc |
| max_upload_size | |
| id | 2043499 |
| size | 7,463,115 |
Part of the Blinc UI Framework
This crate is a component of Blinc, a GPU-accelerated UI framework for Rust. For full documentation and guides, visit the Blinc documentation.
High-level application framework for Blinc UI, combining layout and GPU rendering.
blinc_app provides the main entry point for building Blinc applications. It integrates the layout engine with GPU rendering and provides both headless and windowed application modes.
use blinc_app::prelude::*;
use blinc_app::windowed::{WindowedApp, WindowConfig};
fn main() -> Result<()> {
let config = WindowConfig {
title: "My App".to_string(),
width: 800,
height: 600,
resizable: true,
..Default::default()
};
WindowedApp::run(config, |ctx| build_ui(ctx))
}
fn build_ui(_ctx: &WindowedContext) -> impl ElementBuilder {
div()
.w_full()
.h_full()
.bg(Color::WHITE)
.flex_col()
.items_center()
.justify_center()
.child(
text("Hello, Blinc!")
.size(48.0)
.weight(FontWeight::Bold)
.color(Color::BLACK)
)
}
use blinc_app::{BlincApp, RenderContext};
fn main() {
let app = BlincApp::new_headless(800, 600);
// Build UI
let ui = div()
.w_full()
.h_full()
.bg(Color::WHITE)
.child(text("Rendered headlessly"));
// Render to texture
let frame = app.render(&ui);
// Save as image
frame.save_png("output.png");
}
let config = WindowConfig {
title: "My App".to_string(),
width: 1024,
height: 768,
min_width: Some(400),
min_height: Some(300),
max_width: None,
max_height: None,
resizable: true,
decorations: true,
transparent: false,
always_on_top: false,
..Default::default()
};
use blinc_app::system_font_paths;
// Get system font directories
let font_paths = system_font_paths();
// Load fonts
for path in font_paths {
app.load_font_directory(&path);
}
blinc_app
├── lib.rs # Main BlincApp type
├── context.rs # RenderContext implementation
├── windowed.rs # WindowedApp for native windows
├── headless.rs # Headless rendering mode
└── prelude.rs # Common re-exports
blinc_app re-exports commonly used types from:
blinc_layout - Layout primitives and elementsblinc_core - Core types (Color, Rect, etc.)blinc_gpu - GPU renderer typesSee the examples/ directory for complete examples:
hello_world.rs - Basic windowed appcn_demo.rs - Component library showcaseimage_layer_test.rs - Image rendering testglass_demo.rs - Glass/blur effectsRun examples with:
cargo run -p blinc_app --example hello_world --features windowed
MIT OR Apache-2.0