Crate gl

source
Expand description

This crate exposes OpenGL bindings in a more idiomatic Rust format.

OpenGL has an idiosynchratic way of testing for errors, often making use of utilities like glGetError to get if the last call has failed. To account for this, this library contains 3 different conventions for function naming.

  • *_unchecked: unsafe functions that should test for an error in most cases, but are left untested to avoid the overhead for when the caller already knows an error-condition has been met.
  • * (unprefixed): safe functions that either test for errors implicitly, or don’t bother need to test at all since the functionality is reasonably safe.
  • *_checked: safe functions that don’t need to test for errors, but are still technically fallible and could be checked. Often this is useful for detecting failures after cases like a glGet* – which is normally reasonably safe to assume will succeed, but may fail from a bad context profile.

Modules§

  • This module provides all that raw definitions of the C OpenGL library.
  • The error module provides definitions of OpenGL errors, and other utilities around operating with them.
  • This module provide information about the current GL context.
  • A module for handling shaders and programs.
  • The vertex crate provides an abstraction over buffer objects so that they follow a more conventional “OO” approach.

Structs§

  • Specify the clear value for the color, depth, and stencil buffers used in clear.

Enums§

  • An enumeration of capabilities that can be tested against.
  • An enumeration of the face to cull

Functions§