134 releases

0.32.3 Apr 30, 2025
0.32.2 Jan 12, 2025
0.32.1 Sep 11, 2024
0.32.0 Jun 8, 2024
0.0.2 Dec 30, 2014

#4 in Graphics APIs

Download history 160908/week @ 2025-06-20 182145/week @ 2025-06-27 159208/week @ 2025-07-04 215145/week @ 2025-07-11 200789/week @ 2025-07-18 189697/week @ 2025-07-25 191465/week @ 2025-08-01 188569/week @ 2025-08-08 176456/week @ 2025-08-15 191046/week @ 2025-08-22 283535/week @ 2025-08-29 229961/week @ 2025-09-05 202943/week @ 2025-09-12 212473/week @ 2025-09-19 220858/week @ 2025-09-26 199274/week @ 2025-10-03

879,141 downloads per month
Used in 779 crates (229 directly)

Apache-2.0

345KB
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–13MB
~132K SLoC