#windowing #opengl

glutin

Cross-platform OpenGL context provider

104 releases

✓ Uses Rust 2018 edition

0.23.0 Feb 7, 2020
0.22.0-alpha5 Nov 15, 2019
0.22.0-alpha1 Jun 21, 2019
0.20.0 Mar 10, 2019
0.0.1 Nov 12, 2014

#11 in Graphics APIs

Download history 7820/week @ 2019-11-01 7253/week @ 2019-11-08 7993/week @ 2019-11-15 7028/week @ 2019-11-22 7014/week @ 2019-11-29 8348/week @ 2019-12-06 9581/week @ 2019-12-13 4784/week @ 2019-12-20 4837/week @ 2019-12-27 8495/week @ 2020-01-03 12628/week @ 2020-01-10 10094/week @ 2020-01-17 10365/week @ 2020-01-24 7845/week @ 2020-01-31 7313/week @ 2020-02-07

34,894 downloads per month
Used in 254 crates (100 directly)

Apache-2.0

290KB
7K SLoC

glutin - OpenGL, UTilities and INput

A low-level library for OpenGL context creation, written in pure Rust.

Docs.rs

[dependencies]
glutin = "0.23"

Documentation

Contact Us

Join us in any of these:

Freenode Matrix Gitter

Usage Examples

Warning: these are examples for master. For the latest released version, 0.23, view here.

Try it!

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

Common issues

Please refer to ISSUES.md.

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 is only officially supported on the latest stable version of the Rust compiler.

Platform-specific notes

Android

To compile the examples for android, you have to use the cargo apk utility.

See the android-rs-glue repository for instructions.

Emscripten with asmjs

Emscripten support has been deprecated in favor of platforms like stdweb. To get an OpenGL context on these platforms, please use crates like glow instead.

X11

The plan is that glutin tries to dynamically link-to and use Wayland w/EGL if possible. If it doesn't work, it will try Xlib w/GLX follow by Xlib w/EGL instead. This is work-in-progress.

Wayland

Due to an issue with how Mesa and Wayland play together, all shared contexts must use the same events pool as each other.

Dependencies

~1.3–2.5MB
~50K SLoC