lueur

Crates.iolueur
lib.rslueur
version0.6.6
sourcesrc
created_at2024-07-21 17:54:10.889385
updated_at2024-07-21 17:54:10.889385
descriptionShadowy game and graphics library for Rust
homepagehttps://cloudhead.io
repository
max_upload_size
id1310481
size259,357
Alexis Sellier (cloudhead)

documentation

README

Ombre

Une ombre est née, dans la lueur d'un ciel étoilé..

Synopsis

Ombre is a "New Jersey" style1 library designed for games and graphics programming on the desktop.

It provides a thin layer of abstraction over the underlying context creation and graphics frameworks while keeping dependencies to a bare minimum, and trying to do the few things it does really well. Ombre also comes with support for various simple file formats that are designed to be easy encode and decode. This is in contrast to more popular formats like PNG and TTF which would likely call for external libraries.

Despite all of the above, Ombre is not meant as a "toy" library. Performance, stability, flexibility and developer friendliness are not compromised. Though certain defaults are chosen, such as the graphics backend, the user is able to easily swap out backends for something more appropriate to their target platform.

Features

  • Context creation and input handling using glfw2
  • Graphics API inspired by sokol-gfx3
  • Cross-platform using an OpenGL 3.3 backend with glow4
  • Bitmap font rendering support for UF1 and UF2 fonts5
  • Image encoding and decoding using the simple RGBA (.rgba) file format
  • Computer graphics math module with 2D and 3D vectors and transforms
  • Color types and functions

Rationale

  • Since all major platforms support OpenGL 3.3, and will do for the foreseable future, there is no reason to target anything else. The glow crate is used for its simplicity, portability, and bare-bones type safety.
  • For context creation and input handling, GLFW is chosen for its maturity and stability, while staying minimal and offering the most flexibility without taking away control from the user.
  • Popular font and image formats such as TTF and PNG are explicitly not supported due to their complexity and low value-add.
  • 3D math is implemented in-house, to avoid depending on yet another abandonned math library, and to offer the best experience.
  • Trying to support all platforms including web and mobile with a single API is bound to leak platform details. We avoid that by focusing on OpenGL and desktop graphics.

Acknowledgments

Big chunks of this library were adapted from miniquad by Fedor Logachev, which itself is adapted from sokol, by Andre Weissflog. Additionally, much of the 3D math code was borrowed from cgmath, and euclid by the Servo Project Developers. Finally it's worth mentioning that druid, by Raph Levien has served as inspiration for the UI code, and some of the math code.

License

Dual-licensed under MIT and Apache.

References

Footnotes

  1. https://dreamsongs.com/WorseIsBetter.html

  2. https://www.glfw.org/

  3. https://floooh.github.io/2017/07/29/sokol-gfx-tour.html

  4. https://crates.io/crates/glow

  5. https://wiki.xxiivv.com/site/ufx_format.html

Commit count: 0

cargo fmt