132 releases

0.32.1 Sep 11, 2024
0.32.0 Jun 8, 2024
0.31.3 Feb 12, 2024
0.31.2 Dec 22, 2023
0.0.2 Dec 30, 2014

#7 in Graphics APIs

Download history 45625/week @ 2024-08-01 57657/week @ 2024-08-08 50298/week @ 2024-08-15 52284/week @ 2024-08-22 54021/week @ 2024-08-29 54238/week @ 2024-09-05 52992/week @ 2024-09-12 54670/week @ 2024-09-19 62090/week @ 2024-09-26 53000/week @ 2024-10-03 50990/week @ 2024-10-10 58486/week @ 2024-10-17 60214/week @ 2024-10-24 62393/week @ 2024-10-31 49364/week @ 2024-11-07 36478/week @ 2024-11-14

219,760 downloads per month
Used in 663 crates (206 directly)

Apache-2.0

330KB
7K SLoC

glutin - OpenGL, UTilities, and INput

A low-level library for OpenGL context creation.

Docs.rs

Documentation

Contact Us

Join us in any of these:

Matrix Libera.Chat

Usage Examples

Warning: These are examples for master. You can find examples for the latest released version here.

The examples use gl_generator to generate OpenGL bindings.

Try it!

git clone https://github.com/rust-windowing/glutin
cd glutin
cargo run --example window

Usage

Glutin is an OpenGL context creation library, and doesn't directly provide OpenGL bindings for you.

For examples, please look here.

Note that glutin aims at being a low-level brick in your rendering infrastructure. You are encouraged to write another layer of abstraction between glutin and your application.

Glutin follows winit's MSRV policy.

Platform-specific notes

Android

Be sure to handle Android's lifecycle correctly when using a winit window by only creating a GL surface after winit raises Event::Resumed, and destroy it again upon receiving Event::Suspended. See this in action in the android.rs example.

To compile and run the Android example on your device, install cargo-apk and start the app using:

$ cargo apk r -p glutin_examples --example android

Dependencies

~0.2–10MB
~96K SLoC