#glutin #gfx #graphics #winit-window #gamedev #extension

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

#197 in Graphics APIs

Download history 703/week @ 2024-08-09 496/week @ 2024-08-16 456/week @ 2024-08-23 612/week @ 2024-08-30 454/week @ 2024-09-06 465/week @ 2024-09-13 615/week @ 2024-09-20 544/week @ 2024-09-27 266/week @ 2024-10-04 323/week @ 2024-10-11 437/week @ 2024-10-18 438/week @ 2024-10-25 454/week @ 2024-11-01 142/week @ 2024-11-08 225/week @ 2024-11-15 387/week @ 2024-11-22

1,276 downloads per month
Used in 18 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–17MB
~242K SLoC