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

#6 in Graphics APIs

Download history 86878/week @ 2025-02-01 251200/week @ 2025-02-08 245748/week @ 2025-02-15 304686/week @ 2025-02-22 341314/week @ 2025-03-01 313797/week @ 2025-03-08 285411/week @ 2025-03-15 262386/week @ 2025-03-22 252448/week @ 2025-03-29 234266/week @ 2025-04-05 203683/week @ 2025-04-12 189311/week @ 2025-04-19 204243/week @ 2025-04-26 213042/week @ 2025-05-03 188292/week @ 2025-05-10 148279/week @ 2025-05-17

790,937 downloads per month
Used in 732 crates (220 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–15MB
~115K SLoC