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

opengl-registry

Rust对OpenGL API和扩展注册表的API

3个不稳定版本

0.2.0 2023年4月2日
0.1.1 2023年3月5日
0.1.0 2023年3月5日

#810 in 图形API

每月 23次下载
opengl-registry-macros 中使用

MIT/Apache

230KB
1.5K SLoC

OpenGL-Registry

Latest Version Documentation

Rust对OpenGL API和扩展注册表的API。

功能

  • include-xml: 将注册表XML文件包含为 &'static str(默认启用)

示例用法

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.

用法

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());
    }
}

依赖关系

~1.6–2.2MB
~40K SLoC