Crate surfman

source ·
Expand description

Cross-platform GPU device and surface management.

You can use this crate to multithread a graphics application so that rendering happens on multiple threads, sharing textures among them in the most efficient manner. It may also be useful as a lightweight framework for just initializing rendering in native applications. This is in contrast to crates like SDL, GLFW, winit, and Glutin, all of which have a broader focus in that they manage windowing and the event loop as well.

Re-exports

Modules

  • An implementation of thread-safe swap chains for the surfman surface manager.
  • The abstract interface that all connections conform to.
  • context 🔒
    Declarations common to all platform contexts.
  • The abstract interface that all devices conform to.
  • egl 🔒
  • Various errors that methods can produce.
  • gl 🔒
  • gl_utils 🔒
    Various OpenGL utilities used by the different backends.
  • info 🔒
    OpenGL information.
  • A macro for use in the top-level crate.
  • Platform-specific backends.
  • A utility module for backends that wrap surfaces in OpenGL FBOs.
  • surface 🔒
    Information related to hardware surfaces.

Macros

  • When using surfman, you should place this macro at the top of your crate, like so:

Structs

  • Various flags that control attributes of the context and/or surfaces created from that context.
  • Attributes that control aspects of a context and/or surfaces created from that context.
  • A unique ID among all currently-allocated contexts.
  • Describes the OpenGL version that is requested when a context is created.
  • A unique ID per allocated surface.
  • Various data about the surface.
  • Various data about the surface.

Enums

  • The API (OpenGL or OpenGL ES).
  • Specifies how and if the CPU has direct access to the surface data.
  • Information specific to the type of surface: generic or widget.