From 0f941eaab3ecf2a7e07c13cf1acfb139f25df189 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 5 Mar 2023 21:45:51 +0100 Subject: docs: add crate root documentation --- src/lib.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 45f9fc9..215ce03 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,22 @@ //! 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()); +//! } +//! } +//! ``` +//! //! [OpenGL API and Extension Registry]: https://github.com/KhronosGroup/OpenGL-Registry #![cfg_attr(doc_cfg, feature(doc_cfg))] #![deny(clippy::all, clippy::pedantic, missing_docs)] -- cgit v1.2.3-18-g5258