1 unstable release

0.6.6 Jul 21, 2024

#67 in Rendering

Download history 69/week @ 2024-07-15 57/week @ 2024-07-22 28/week @ 2024-07-29 13/week @ 2024-08-26 17/week @ 2024-09-16 40/week @ 2024-09-23 4/week @ 2024-09-30 1/week @ 2024-10-07 5/week @ 2024-10-14

51 downloads per month
Used in 2 crates

MIT/Apache

225KB
6K SLoC

Ombre

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

Synopsis

Ombre is a "New Jersey" style^0 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 glfw^1
  • Graphics API inspired by sokol-gfx^2
  • Cross-platform using an OpenGL 3.3 backend with glow^3
  • Bitmap font rendering support for UF1 and UF2 fonts^4
  • 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

Dependencies

~4–12MB
~158K SLoC