8 releases (breaking)

0.8.0 Jul 24, 2020
0.7.0 Jul 29, 2019
0.6.0 Mar 24, 2019
0.5.0 Jan 9, 2019
0.1.0 Dec 31, 2017

#144 in Graphics APIs

Download history 15/week @ 2021-08-05 12/week @ 2021-08-12 6/week @ 2021-08-19 3/week @ 2021-08-26 1/week @ 2021-09-02 6/week @ 2021-09-09 4/week @ 2021-09-16 11/week @ 2021-09-23 1/week @ 2021-09-30 3/week @ 2021-10-07 2/week @ 2021-10-14 12/week @ 2021-10-21 18/week @ 2021-11-04 11/week @ 2021-11-18

57 downloads per month
Used in 2 crates

MIT/Apache

150KB
3K SLoC

grr!

A bare metal library for OpenGL 4.5+

crates.io docs license-mit license-apache2 Build Status

[dependencies]
grr = "0.8"

grr aims at providing a thin layer above OpenGL 4.5+, exposing a modern API orientated on Vulkan. The sole purpose of the library is to have a cleaned up API for fast prototyping.

Features

  • API is built around direct state access
  • Following Vulkan terminology and function names
  • Only provided latest GL functionality
  • Enforce sRGB framebuffer handling

Getting started

Checkout our Hello Triangle example to see the library in action!

Example

// Bind graphics pipeline (shaders)
grr.bind_pipeline(&pipeline);
// Configure vertex attributes
grr.bind_vertex_array(&vertex_array);
// Bind vertex buffers for fetching attribute data
grr.bind_vertex_buffers(
    &vertex_array,
    0,
    &[grr::VertexBufferView {
        buffer: &triangle_data,
        offset: 0,
        stride: (std::mem::size_of::<f32>() * 5) as _,
        input_rate: grr::InputRate::Vertex,
    }]
);

// Clear default framebuffer
grr.clear_attachment(grr::Framebuffer::DEFAULT, grr::ClearAttachment::ColorFloat(0, [0.5, 0.5, 0.5, 1.0]));
// Draw triangles
grr.draw(grr::Primitive::Triangles, 0..3, 0..1);

// Present on screen!
window.swap_buffers().unwrap();

Examples

Hello Triangle

cargo run --example triangle

Device Information

cargo run --example device

Texture (Logo)

cargo run --example texture

(Maybe-)Physically-based Rendering (IBL)

Assets (model and HDRI) need to be extracted into examples/assets before running it!

cargo run --example pbr --release

Dependencies

~130KB

*_