| Crates.io | glfw-ext |
| lib.rs | glfw-ext |
| version | 0.59.0 |
| created_at | 2023-05-25 17:27:35.118172+00 |
| updated_at | 2025-06-18 02:22:46.285255+00 |
| description | GLFW utilities and extension methods |
| homepage | |
| repository | https://github.com/vallentin/glfw-ext |
| max_upload_size | |
| id | 874440 |
| size | 12,626 |
Utilities and extension methods for glfw.
The version of glfw-ext follows the version of glfw.
Center window on the dominant monitor.
use glfw_ext::WindowExt;
// Center the window on the dominant monitor, i.e. if
// the window is 20% on monitor A and 80% on monitor B,
// then the window is centered onto monitor B
wnd.try_center();
Center window on primary monitor:
use glfw_ext::WindowExt;
// Center the window on the primary monitor
glfw.with_primary_monitor(|_glfw, monitor| {
if let Some(monitor) = monitor {
wnd.try_center_on_monitor(monitor);
}
});
See examples/center_window.rs for a complete example.