12 releases (5 breaking)

✓ Uses Rust 2018 edition

0.8.0 Sep 29, 2019
0.6.0 Sep 12, 2019
0.2.4 Jul 26, 2018
0.1.1 Oct 1, 2017

#58 in Graphics APIs

Download history 13/week @ 2019-06-15 26/week @ 2019-06-22 7/week @ 2019-06-29 60/week @ 2019-07-06 4/week @ 2019-07-13 16/week @ 2019-07-20 2/week @ 2019-07-27 5/week @ 2019-08-03 8/week @ 2019-08-10 11/week @ 2019-08-17 136/week @ 2019-08-24 69/week @ 2019-08-31 122/week @ 2019-09-07 73/week @ 2019-09-14 167/week @ 2019-09-21

225 downloads per month
Used in 5 crates (3 directly)

BSD-3-Clause

315KB
6K SLoC

luminance windowing

This is the base, abstract crate for windowing common types and functions in luminance. The luminance crate provides you with abstracting over OpenGL, but it doesn’t give you a way to create an OpenGL context. This is due to the fact that creating and managing OpenGL contexts is tightly related to the type of application you target. Typical PC applications might need something like GLFW or glutin whilst others will directly bind to X11 or Windows API. Several crates – luminance-* – exist to solve that problem. They all provide a different implementation for a simple need: opening an OpenGL context, opening a window and manage events. In theory, you could even have a luminance-gtk or luminance-qt to embed luminance in surfaces in those libraries.

What’s included

This crate exposes several important types that all backends must use. Among them, you’ll find:

  • WindowDim: abstraction over the dimension of a window and its mode (windowed, fullscreen, fullscreen restricted).
  • WindowOpt: an opaque type giving access to hints to customize the window integration, such as whether the cursor should be hidden or not.

The Device trait must be implemented by a backend so that an application is completely agnostic of the backend. This trait defines several basic methods that will help you to:

  • Retrieve the dimension of the window / framebuffer.
  • Iterate over the system events captured by your application.
  • Draw and swap the buffer chain.

Dependencies