#opengl #api #registry

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

#892 in Graphics APIs

23 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–2MB
~38K SLoC