rgl/lib.rs
1//! # Rusty GL
2//! `rusty_gl` is a wrapper over the C-binding for OpenGL for Rust, gl-rs
3//! The aim of this crate is:
4//! 1. Make OpenGL in Rust easier to use
5//!
6//! This has been done by hiding weird (and unsafe!) casts from Rust code to the
7//! C interface, as well as using rust types over std::os::raw and std::ffi types. For example,
8//! some functions take in &str rather than std::ffi::CString.
9//!
10//! 2. Make OpenGL in Rust safer to use
11//!
12//! One way I have done this is by enforcing correct enum types when passing to functions.
13//! The C-Interface allowed for any GLenum to pass into a function where it was needed, but
14//! it is very easy to pass the wrong one, causing `GL_INVALID_ENUM` errors.
15//! Instead, I have made specific enum types, and then enforce those types when calling rusty-gl
16//! functions
17//!
18//! 3. Make OpenGL in Rust fit along nicely with other Rust code
19//!
20//! The C interface had camelCase interface, as well as requiring `unsafe` blocks everywhere.
21//! Rusty GL functions use the more Rust accepted `snake_case` for functions and `PascalCase`
22//! for types. Also, none of the functions require `unsafe {}` blocks to be used.
23
24extern crate gl;
25
26pub mod buffers;
27pub mod drawing;
28pub mod enums;
29pub mod shaders;
30pub mod textures;
31
32pub use buffers::*;
33pub use drawing::*;
34pub use enums::*;
35pub use shaders::*;
36pub use textures::*;