#opengl #api #registry #extension #xml #api-bindings #default

opengl-registry

Rust API for the OpenGL API and Extension Registry

3 unstable releases

0.2.0 Apr 2, 2023
0.1.1 Mar 5, 2023
0.1.0 Mar 5, 2023

#779 in Graphics APIs

Download history 75/week @ 2024-02-19 49/week @ 2024-02-26 2/week @ 2024-03-11 54/week @ 2024-04-01

56 downloads per month
Used in opengl-registry-macros

MIT/Apache

230KB
1.5K SLoC

OpenGL-Registry

Latest Version Documentation

Rust API for the OpenGL API and Extension Registry.

Features

  • include-xml: Include the registry XML file as a &'static str (Enabled by default)

Example usage

use opengl_registry::Registry;

let registry = Registry::retrieve().unwrap();

for command in registry.commands() {
    println!("Command {}", command.prototype().name());
    println!("  Return type: {}", command.prototype().return_type());
    println!("  Parameters:");

    for param in command.parameters() {
        println!("  {} {}", param.get_type(), param.name());
    }
}

lib.rs:

Rust API for the OpenGL API and Extension Registry.

Usage

use opengl_registry::Registry;

let registry = Registry::retrieve().unwrap();

for command in registry.commands() {
    println!("Command {}", command.prototype().name());
    println!("  Return type: {}", command.prototype().return_type());
    println!("  Parameters:");

    for param in command.parameters() {
        println!("  {} {}", param.get_type(), param.name());
    }
}

Dependencies

~1.5–2.1MB
~40K SLoC