aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-03-05 21:45:51 +0100
committerHampusM <hampus@hampusmat.com>2023-03-05 21:45:51 +0100
commit0f941eaab3ecf2a7e07c13cf1acfb139f25df189 (patch)
treec5cef00555a1c478117a498339360ea87734b540
parent66f90122b44a6ebb75fa0df83c80dbfccf77a422 (diff)
docs: add crate root documentation
-rw-r--r--src/lib.rs17
1 files changed, 17 insertions, 0 deletions
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)]