| Crates.io | blinc_platform_desktop |
| lib.rs | blinc_platform_desktop |
| version | 0.1.12 |
| created_at | 2026-01-14 18:46:44.879478+00 |
| updated_at | 2026-01-19 01:07:38.711032+00 |
| description | Blinc desktop platform - macOS, Windows, Linux windowing and input |
| homepage | |
| repository | https://github.com/project-blinc/Blinc |
| max_upload_size | |
| id | 2043445 |
| size | 75,807 |
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.
Desktop platform implementation for Blinc UI.
blinc_platform_desktop provides windowing, input handling, and event loop implementation for desktop platforms (macOS, Windows, Linux) using winit.
use blinc_platform_desktop::DesktopPlatform;
use blinc_platform::{Platform, WindowConfig};
fn main() {
let platform = DesktopPlatform::new();
let window = platform.create_window(WindowConfig {
title: "My App".to_string(),
width: 800,
height: 600,
..Default::default()
});
platform.run(|event| {
match event {
Event::RedrawRequested(_) => {
// Render your UI
}
Event::WindowEvent { event, .. } => {
// Handle window events
}
_ => {}
}
ControlFlow::Poll
});
}
#[cfg(target_os = "macos")]
{
// Native title bar integration
window.set_titlebar_transparent(true);
// Vibrancy effects
window.set_background_appearance(NSVisualEffectMaterial::Sidebar);
// Full screen support
window.set_fullscreen(Some(Fullscreen::Borderless));
}
#[cfg(target_os = "windows")]
{
// DWM composition
window.enable_blur_behind();
// Taskbar integration
window.set_taskbar_progress(0.5);
}
#[cfg(target_os = "linux")]
{
// Wayland-specific
window.set_app_id("com.example.myapp");
// X11-specific
window.set_wm_class("MyApp", "myapp");
}
platform.run(|event| {
match event {
// Window lifecycle
Event::WindowEvent { event: WindowEvent::CloseRequested, .. } => {
return ControlFlow::Exit;
}
// Input
Event::WindowEvent { event: WindowEvent::KeyboardInput { input, .. }, .. } => {
handle_key(input);
}
Event::WindowEvent { event: WindowEvent::CursorMoved { position, .. }, .. } => {
handle_mouse_move(position.x, position.y);
}
// Redraw
Event::RedrawRequested(_) => {
render();
}
_ => {}
}
ControlFlow::Poll
});
libxkbcommon-dev, libwayland-dev, libxrandr-devlibwayland-dev, libxkbcommon-devMIT OR Apache-2.0