#oldschool #glutin #graphics #gfx

old_school_gfx_glutin_ext

Extensions for glutin to initialize & update old school gfx

18 releases (breaking)

0.34.0 Jun 23, 2024
0.32.1 Dec 24, 2023
0.32.0 Oct 24, 2023
0.31.0 Feb 4, 2023
0.24.0 Mar 12, 2020

#396 in Graphics APIs

Download history 1038/week @ 2025-04-28 749/week @ 2025-05-05 835/week @ 2025-05-12 316/week @ 2025-05-19 289/week @ 2025-05-26 157/week @ 2025-06-02 287/week @ 2025-06-09 593/week @ 2025-06-16 837/week @ 2025-06-23 261/week @ 2025-06-30 711/week @ 2025-07-07 995/week @ 2025-07-14 915/week @ 2025-07-21 641/week @ 2025-07-28 461/week @ 2025-08-04 784/week @ 2025-08-11

2,930 downloads per month
Used in 19 crates (5 directly)

Apache-2.0

23KB
257 lines

old_school_gfx_glutin_ext crates.io Documentation

Initialise & update old school gfx with glutin + winit.

type ColorFormat = gfx::format::Srgba8;
type DepthFormat = gfx::format::DepthStencil;

let window_attrs = winit::window::Window::default_attributes();

// 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_attrs)
    .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–19MB
~287K SLoC