133 releases

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

#8 in Graphics APIs

Download history 34109/week @ 2024-12-22 35760/week @ 2024-12-29 57967/week @ 2025-01-05 74473/week @ 2025-01-12 67923/week @ 2025-01-19 62298/week @ 2025-01-26 92534/week @ 2025-02-02 262511/week @ 2025-02-09 245391/week @ 2025-02-16 311038/week @ 2025-02-23 331566/week @ 2025-03-02 321924/week @ 2025-03-09 274466/week @ 2025-03-16 266463/week @ 2025-03-23 249298/week @ 2025-03-30 217175/week @ 2025-04-06

1,035,704 downloads per month
Used in 720 crates (216 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–11MB
~110K SLoC