130 releases

0.31.3 Feb 12, 2024
0.31.2 Dec 22, 2023
0.31.1 Oct 29, 2023
0.30.9 Jun 16, 2023
0.0.2 Dec 30, 2014

#2 in #opengl

Download history 40692/week @ 2024-02-06 44391/week @ 2024-02-13 42808/week @ 2024-02-20 42302/week @ 2024-02-27 41908/week @ 2024-03-05 39477/week @ 2024-03-12 46595/week @ 2024-03-19 45925/week @ 2024-03-26 47026/week @ 2024-04-02 38046/week @ 2024-04-09 46006/week @ 2024-04-16 45222/week @ 2024-04-23 40333/week @ 2024-04-30 39490/week @ 2024-05-07 45277/week @ 2024-05-14 37850/week @ 2024-05-21

169,311 downloads per month
Used in 637 crates (199 directly)

Apache-2.0

325KB
7K SLoC

glutin - OpenGL, UTilities, and INput

A low-level library for OpenGL context creation.

Docs.rs

[dependencies]
glutin = "0.31.3"

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–14MB
~153K SLoC