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ยง
pub use unix as default;pub use crate::error::Error;pub use crate::error::WindowingApiError;pub use default::connection::Connection;pub use default::connection::NativeConnection;pub use default::context::Context;pub use default::context::ContextDescriptor;pub use default::context::NativeContext;pub use default::device::Adapter;pub use default::device::Device;pub use default::device::NativeDevice;pub use default::surface::NativeWidget;pub use default::surface::Surface;pub use default::surface::SurfaceTexture;
Modulesยง
- base ๐
- Shared support code that can be used by multiple Surfman backends.
- chains
- An implementation of thread-safe swap chains for the
surfmansurface manager. - connection
- The abstract interface that all connections conform to.
- context ๐
- Declarations common to all platform contexts.
- device
- The abstract interface that all devices conform to.
- egl ๐
- error
- Various errors that methods can produce.
- gl_
utils ๐ - Various OpenGL utilities used by the different backends.
- info ๐
- OpenGL information.
- macros
- A macro for use in the top-level crate.
- mesa_
surfaceless - The Mesa โsurfacelessโ backend, which only supports off-screen surfaces and cannot directly display surfaces on a screen.
- multi
- An abstraction that allows the choice of backends dynamically.
- renderbuffers ๐
- A utility module for backends that wrap surfaces in OpenGL FBOs.
- surface ๐
- Information related to hardware surfaces.
- unix
- The default backend for Unix, which dynamically switches between Wayland, X11 and surfaceless.
- wayland
- Bindings to Wayland via the Linux GBM interface.
- x11
- Bindings to EGL via Xlib.
Macrosยง
- declare_
surfman - When using
surfman, you should place this macro at the top of your crate, like so:
Structsยง
- Context
Attribute Flags - Various flags that control attributes of the context and/or surfaces created from that context.
- Context
Attributes - Attributes that control aspects of a context and/or surfaces created from that context.
- ContextID
- A unique ID among all currently-allocated contexts.
- GLVersion
- Describes the OpenGL version that is requested when a context is created.
- SurfaceID
- A unique ID per allocated surface.
- Surface
Info - Various data about the surface.
- System
Surface Info - Various data about the surface.
Enumsยง
- GLApi
- The API (OpenGL or OpenGL ES).
- Surface
Access - Specifies how and if the CPU has direct access to the surface data.
- Surface
Type - Information specific to the type of surface: generic or widget.