15 releases (breaking)
0.32.0 | Oct 24, 2023 |
---|---|
0.31.0 | Feb 4, 2023 |
0.30.2 | Jan 27, 2023 |
0.30.1 | Dec 22, 2022 |
0.24.0 | Mar 12, 2020 |
#220 in Graphics APIs
2,707 downloads per month
Used in 17 crates
(5 directly)
22KB
256 lines
old_school_gfx_glutin_ext

Initialise & update old school gfx with glutin + winit.
type ColorFormat = gfx::format::Srgba8;
type DepthFormat = gfx::format::DepthStencil;
let event_loop = winit::event_loop::EventLoop::new();
let window_builder = winit::window::WindowBuilder::new();
// Initialise winit window, glutin context & gfx views
let old_school_gfx_glutin_ext::Init {
// winit window
window,
// glutin bits
gl_config,
gl_surface,
gl_context,
// gfx bits
mut device,
mut factory,
mut color_view,
mut depth_view,
..
} = old_school_gfx_glutin_ext::window_builder(&event_loop, window_builder)
.build::<ColorFormat, DepthFormat>()?;
// Update gfx views, e.g. after a window resize
old_school_gfx_glutin_ext::resize_views(new_size, &mut color_view, &mut depth_view);
Example
cargo run --example triangle
Minimum supported rust compiler
All crates maintained with latest stable rust.
Dependencies
~3–16MB
~225K SLoC