#![allow(
clippy::too_many_arguments,
clippy::let_and_return,
clippy::from_over_into,
clippy::upper_case_acronyms
)]
use super::{Bitmap, Offscreen, Onscreen};
use std::fmt;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum AttributeType {
Byte,
UnsignedByte,
Short,
UnsignedShort,
Float,
}
impl fmt::Display for AttributeType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"AttributeType::{}",
match *self {
AttributeType::Byte => "Byte",
AttributeType::UnsignedByte => "UnsignedByte",
AttributeType::Short => "Short",
AttributeType::UnsignedShort => "UnsignedShort",
AttributeType::Float => "Float",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum BitmapError {
Failed,
UnknownType,
CorruptImage,
}
impl fmt::Display for BitmapError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"BitmapError::{}",
match *self {
BitmapError::Failed => "Failed",
BitmapError::UnknownType => "UnknownType",
BitmapError::CorruptImage => "CorruptImage",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum BlendStringError {
ParseError,
ArgumentParseError,
InvalidError,
GpuUnsupportedError,
}
impl fmt::Display for BlendStringError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"BlendStringError::{}",
match *self {
BlendStringError::ParseError => "ParseError",
BlendStringError::ArgumentParseError => "ArgumentParseError",
BlendStringError::InvalidError => "InvalidError",
BlendStringError::GpuUnsupportedError => "GpuUnsupportedError",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum BufferError {
BufferErrorMap,
}
impl fmt::Display for BufferError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"BufferError::{}",
match *self {
BufferError::BufferErrorMap => "BufferErrorMap",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum BufferUpdateHint {
Static,
Dynamic,
Stream,
}
impl Default for BufferUpdateHint {
fn default() -> Self {
Self::Static
}
}
impl fmt::Display for BufferUpdateHint {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"BufferUpdateHint::{}",
match *self {
BufferUpdateHint::Static => "Static",
BufferUpdateHint::Dynamic => "Dynamic",
BufferUpdateHint::Stream => "Stream",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum DepthTestFunction {
Never,
Less,
Equal,
Lequal,
Greater,
Notequal,
Gequal,
Always,
}
impl fmt::Display for DepthTestFunction {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"DepthTestFunction::{}",
match *self {
DepthTestFunction::Never => "Never",
DepthTestFunction::Less => "Less",
DepthTestFunction::Equal => "Equal",
DepthTestFunction::Lequal => "Lequal",
DepthTestFunction::Greater => "Greater",
DepthTestFunction::Notequal => "Notequal",
DepthTestFunction::Gequal => "Gequal",
DepthTestFunction::Always => "Always",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum Driver {
Any,
Nop,
Gl,
Gl3,
Gles1,
Gles2,
Webgl,
}
impl Default for Driver {
fn default() -> Self {
Self::Any
}
}
impl fmt::Display for Driver {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"Driver::{}",
match *self {
Driver::Any => "Any",
Driver::Nop => "Nop",
Driver::Gl => "Gl",
Driver::Gl3 => "Gl3",
Driver::Gles1 => "Gles1",
Driver::Gles2 => "Gles2",
Driver::Webgl => "Webgl",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum FeatureID {
OglFeatureIdTextureNpotBasic,
OglFeatureIdTextureNpotMipmap,
OglFeatureIdTextureNpotRepeat,
OglFeatureIdTextureNpot,
OglFeatureIdTextureRectangle,
OglFeatureIdTexture3d,
OglFeatureIdGlsl,
OglFeatureIdArbfp,
OglFeatureIdOffscreen,
OglFeatureIdOffscreenMultisample,
OglFeatureIdOnscreenMultiple,
OglFeatureIdUnsignedIntIndices,
OglFeatureIdDepthRange,
OglFeatureIdPointSprite,
OglFeatureIdMapBufferForRead,
OglFeatureIdMapBufferForWrite,
OglFeatureIdMirroredRepeat,
OglFeatureIdSwapBuffersEvent,
OglFeatureIdGles2Context,
OglFeatureIdDepthTexture,
OglFeatureIdPresentationTime,
OglFeatureIdFence,
OglFeatureIdPerVertexPointSize,
OglFeatureIdTextureRg,
OglFeatureIdBufferAge,
}
impl fmt::Display for FeatureID {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"FeatureID::{}",
match *self {
FeatureID::OglFeatureIdTextureNpotBasic => "OglFeatureIdTextureNpotBasic",
FeatureID::OglFeatureIdTextureNpotMipmap => "OglFeatureIdTextureNpotMipmap",
FeatureID::OglFeatureIdTextureNpotRepeat => "OglFeatureIdTextureNpotRepeat",
FeatureID::OglFeatureIdTextureNpot => "OglFeatureIdTextureNpot",
FeatureID::OglFeatureIdTextureRectangle => "OglFeatureIdTextureRectangle",
FeatureID::OglFeatureIdTexture3d => "OglFeatureIdTexture3d",
FeatureID::OglFeatureIdGlsl => "OglFeatureIdGlsl",
FeatureID::OglFeatureIdArbfp => "OglFeatureIdArbfp",
FeatureID::OglFeatureIdOffscreen => "OglFeatureIdOffscreen",
FeatureID::OglFeatureIdOffscreenMultisample => "OglFeatureIdOffscreenMultisample",
FeatureID::OglFeatureIdOnscreenMultiple => "OglFeatureIdOnscreenMultiple",
FeatureID::OglFeatureIdUnsignedIntIndices => "OglFeatureIdUnsignedIntIndices",
FeatureID::OglFeatureIdDepthRange => "OglFeatureIdDepthRange",
FeatureID::OglFeatureIdPointSprite => "OglFeatureIdPointSprite",
FeatureID::OglFeatureIdMapBufferForRead => "OglFeatureIdMapBufferForRead",
FeatureID::OglFeatureIdMapBufferForWrite => "OglFeatureIdMapBufferForWrite",
FeatureID::OglFeatureIdMirroredRepeat => "OglFeatureIdMirroredRepeat",
FeatureID::OglFeatureIdSwapBuffersEvent => "OglFeatureIdSwapBuffersEvent",
FeatureID::OglFeatureIdGles2Context => "OglFeatureIdGles2Context",
FeatureID::OglFeatureIdDepthTexture => "OglFeatureIdDepthTexture",
FeatureID::OglFeatureIdPresentationTime => "OglFeatureIdPresentationTime",
FeatureID::OglFeatureIdFence => "OglFeatureIdFence",
FeatureID::OglFeatureIdPerVertexPointSize => "OglFeatureIdPerVertexPointSize",
FeatureID::OglFeatureIdTextureRg => "OglFeatureIdTextureRg",
FeatureID::OglFeatureIdBufferAge => "OglFeatureIdBufferAge",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum FilterReturn {
Continue,
Remove,
}
impl fmt::Display for FilterReturn {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"FilterReturn::{}",
match *self {
FilterReturn::Continue => "Continue",
FilterReturn::Remove => "Remove",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum FogMode {
Linear,
Exponential,
ExponentialSquared,
}
impl fmt::Display for FogMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"FogMode::{}",
match *self {
FogMode::Linear => "Linear",
FogMode::Exponential => "Exponential",
FogMode::ExponentialSquared => "ExponentialSquared",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum FrameEvent {
Sync,
Complete,
}
impl fmt::Display for FrameEvent {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"FrameEvent::{}",
match *self {
FrameEvent::Sync => "Sync",
FrameEvent::Complete => "Complete",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum FramebufferError {
FramebufferErrorAllocate,
}
impl fmt::Display for FramebufferError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"FramebufferError::{}",
match *self {
FramebufferError::FramebufferErrorAllocate => "FramebufferErrorAllocate",
}
)
}
}
pub enum FramebufferStateIndex {
Bind = 0,
ViewPort = 1,
Clip = 2,
Dither = 3,
ModelView = 4,
Projection = 5,
ColorMask = 6,
FrontFaceWinding = 7,
DepthWrite = 8,
StereoMode = 9,
Max = 10,
}
pub enum FramebufferState {
Bind = 1 << 0,
ViewPort = 1 << 1,
Clip = 1 << 2,
Dither = 1 << 3,
ModelView = 1 << 4,
Projection = 1 << 5,
ColorMask = 1 << 6,
FrontFaceWinding = 1 << 7,
DepthWrite = 1 << 8,
StereoMode = 1 << 9,
}
#[derive(Debug)]
pub enum FramebufferType {
OnScreen(Onscreen),
OffScreen(Offscreen),
}
impl Default for FramebufferType {
fn default() -> Self {
Self::OnScreen(Default::default())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum GLES2ContextError {
Unsupported,
Driver,
}
impl fmt::Display for GLES2ContextError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"GLES2ContextError::{}",
match *self {
GLES2ContextError::Unsupported => "Unsupported",
GLES2ContextError::Driver => "Driver",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum IndicesType {
Byte,
Short,
Int,
}
impl fmt::Display for IndicesType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"IndicesType::{}",
match *self {
IndicesType::Byte => "Byte",
IndicesType::Short => "Short",
IndicesType::Int => "Int",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum MaterialAlphaFunc {
Never,
Less,
Equal,
Lequal,
Greater,
Notequal,
Gequal,
Always,
}
impl fmt::Display for MaterialAlphaFunc {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"MaterialAlphaFunc::{}",
match *self {
MaterialAlphaFunc::Never => "Never",
MaterialAlphaFunc::Less => "Less",
MaterialAlphaFunc::Equal => "Equal",
MaterialAlphaFunc::Lequal => "Lequal",
MaterialAlphaFunc::Greater => "Greater",
MaterialAlphaFunc::Notequal => "Notequal",
MaterialAlphaFunc::Gequal => "Gequal",
MaterialAlphaFunc::Always => "Always",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum MaterialFilter {
Nearest,
Linear,
NearestMipmapNearest,
LinearMipmapNearest,
NearestMipmapLinear,
LinearMipmapLinear,
}
impl fmt::Display for MaterialFilter {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"MaterialFilter::{}",
match *self {
MaterialFilter::Nearest => "Nearest",
MaterialFilter::Linear => "Linear",
MaterialFilter::NearestMipmapNearest => "NearestMipmapNearest",
MaterialFilter::LinearMipmapNearest => "LinearMipmapNearest",
MaterialFilter::NearestMipmapLinear => "NearestMipmapLinear",
MaterialFilter::LinearMipmapLinear => "LinearMipmapLinear",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum MaterialLayerType {
Texture,
}
impl fmt::Display for MaterialLayerType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"MaterialLayerType::{}",
match *self {
MaterialLayerType::Texture => "Texture",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum MaterialWrapMode {
Repeat,
ClampToEdge,
Automatic,
}
impl fmt::Display for MaterialWrapMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"MaterialWrapMode::{}",
match *self {
MaterialWrapMode::Repeat => "Repeat",
MaterialWrapMode::ClampToEdge => "ClampToEdge",
MaterialWrapMode::Automatic => "Automatic",
}
)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum OffscreenAllocateFlags {
None = 0,
DepthStencil = 1 << 0,
Depth = 1 << 1,
Stencil = 1 << 2,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum OffscreenFlags {
None = 0,
DisableDepthAndStencil = 1,
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PipelineAlphaFunc {
Never,
Less,
Equal,
Lequal,
Greater,
Notequal,
Gequal,
Always,
}
impl fmt::Display for PipelineAlphaFunc {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PipelineAlphaFunc::{}",
match *self {
PipelineAlphaFunc::Never => "Never",
PipelineAlphaFunc::Less => "Less",
PipelineAlphaFunc::Equal => "Equal",
PipelineAlphaFunc::Lequal => "Lequal",
PipelineAlphaFunc::Greater => "Greater",
PipelineAlphaFunc::Notequal => "Notequal",
PipelineAlphaFunc::Gequal => "Gequal",
PipelineAlphaFunc::Always => "Always",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PipelineCullFaceMode {
None,
Front,
Back,
Both,
}
impl fmt::Display for PipelineCullFaceMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PipelineCullFaceMode::{}",
match *self {
PipelineCullFaceMode::None => "None",
PipelineCullFaceMode::Front => "Front",
PipelineCullFaceMode::Back => "Back",
PipelineCullFaceMode::Both => "Both",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PipelineFilter {
Nearest,
Linear,
NearestMipmapNearest,
LinearMipmapNearest,
NearestMipmapLinear,
LinearMipmapLinear,
}
impl fmt::Display for PipelineFilter {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PipelineFilter::{}",
match *self {
PipelineFilter::Nearest => "Nearest",
PipelineFilter::Linear => "Linear",
PipelineFilter::NearestMipmapNearest => "NearestMipmapNearest",
PipelineFilter::LinearMipmapNearest => "LinearMipmapNearest",
PipelineFilter::NearestMipmapLinear => "NearestMipmapLinear",
PipelineFilter::LinearMipmapLinear => "LinearMipmapLinear",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PipelineWrapMode {
Repeat,
MirroredRepeat,
ClampToEdge,
Automatic,
}
impl fmt::Display for PipelineWrapMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PipelineWrapMode::{}",
match *self {
PipelineWrapMode::Repeat => "Repeat",
PipelineWrapMode::MirroredRepeat => "MirroredRepeat",
PipelineWrapMode::ClampToEdge => "ClampToEdge",
PipelineWrapMode::Automatic => "Automatic",
}
)
}
}
const BIT_A: u32 = 1 << 4;
const BIT_BGR: u32 = 1 << 5;
const BIT_AFIRST: u32 = 1 << 6;
const BIT_PREMULT: u32 = 1 << 7;
const BIT_DEPTH: u32 = 1 << 8;
const BIT_STENCIL: u32 = 1 << 9;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[repr(u32)]
pub enum PixelFormat {
Any = 0,
A8 = 1 | BIT_A,
Rgb565 = 4,
Rgba4444 = 5 | BIT_A,
Rgba5551 = 6 | BIT_A,
Yuv = 7,
G8 = 8,
Rg88 = 9,
Rgb888 = 2,
Bgr888 = 2 | BIT_BGR,
Rgba8888 = 3 | BIT_A,
Bgra8888 = 3 | BIT_A | BIT_BGR,
Argb8888 = 3 | BIT_A | BIT_AFIRST,
Abgr8888 = 3 | BIT_A | BIT_BGR | BIT_AFIRST,
Rgba1010102 = 13 | BIT_A,
Bgra1010102 = 13 | BIT_A | BIT_BGR,
Argb2101010 = 13 | BIT_A | BIT_AFIRST,
Abgr2101010 = 13 | BIT_A | BIT_BGR | BIT_AFIRST,
Rgba8888Pre = 3 | BIT_A | BIT_PREMULT,
Bgra8888Pre = 3 | BIT_A | BIT_PREMULT | BIT_BGR,
Argb8888Pre = 3 | BIT_A | BIT_PREMULT | BIT_AFIRST,
Abgr8888Pre = 3 | BIT_A | BIT_PREMULT | BIT_BGR | BIT_AFIRST,
Rgba4444Pre = (5 | BIT_A) | BIT_A | BIT_PREMULT,
Rgba5551Pre = (6 | BIT_A) | BIT_A | BIT_PREMULT,
Rgba1010102Pre = (13 | BIT_A) | BIT_PREMULT,
Bgra1010102Pre = (13 | BIT_A | BIT_BGR) | BIT_PREMULT,
Argb2101010Pre = (13 | BIT_A | BIT_AFIRST) | BIT_PREMULT,
Abgr2101010Pre = (13 | BIT_A | BIT_BGR | BIT_AFIRST) | BIT_PREMULT,
Depth16 = (9 | BIT_DEPTH),
Depth32 = (3 | BIT_DEPTH),
Depth24Stencil8 = (3 | BIT_DEPTH | BIT_STENCIL),
}
impl PixelFormat {
pub fn bytes_per_pixel(&self) -> u32 {
let bpp: [u32; 16] = [0, 1, 3, 4, 2, 2, 2, 0, 1, 2, 0, 0, 3, 4, 0, 0];
let idx = *self as usize & 0xf;
bpp[idx]
}
}
impl Default for PixelFormat {
fn default() -> Self {
Self::Rgba8888
}
}
impl fmt::Display for PixelFormat {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PixelFormat::{}",
match *self {
PixelFormat::Any => "Any",
PixelFormat::A8 => "A8",
PixelFormat::Rgb565 => "Rgb565",
PixelFormat::Rgba4444 => "Rgba4444",
PixelFormat::Rgba5551 => "Rgba5551",
PixelFormat::Yuv => "Yuv",
PixelFormat::G8 => "G8",
PixelFormat::Rg88 => "Rg88",
PixelFormat::Rgb888 => "Rgb888",
PixelFormat::Bgr888 => "Bgr888",
PixelFormat::Rgba8888 => "Rgba8888",
PixelFormat::Bgra8888 => "Bgra8888",
PixelFormat::Argb8888 => "Argb8888",
PixelFormat::Abgr8888 => "Abgr8888",
PixelFormat::Rgba1010102 => "Rgba1010102",
PixelFormat::Bgra1010102 => "Bgra1010102",
PixelFormat::Argb2101010 => "Argb2101010",
PixelFormat::Abgr2101010 => "Abgr2101010",
PixelFormat::Rgba8888Pre => "Rgba8888Pre",
PixelFormat::Bgra8888Pre => "Bgra8888Pre",
PixelFormat::Argb8888Pre => "Argb8888Pre",
PixelFormat::Abgr8888Pre => "Abgr8888Pre",
PixelFormat::Rgba4444Pre => "Rgba4444Pre",
PixelFormat::Rgba5551Pre => "Rgba5551Pre",
PixelFormat::Rgba1010102Pre => "Rgba1010102Pre",
PixelFormat::Bgra1010102Pre => "Bgra1010102Pre",
PixelFormat::Argb2101010Pre => "Argb2101010Pre",
PixelFormat::Abgr2101010Pre => "Abgr2101010Pre",
PixelFormat::Depth16 => "Depth16",
PixelFormat::Depth32 => "Depth32",
PixelFormat::Depth24Stencil8 => "Depth24Stencil8",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PollFDEvent {
In,
Pri,
Out,
Err,
Hup,
Nval,
}
impl fmt::Display for PollFDEvent {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PollFDEvent::{}",
match *self {
PollFDEvent::In => "In",
PollFDEvent::Pri => "Pri",
PollFDEvent::Out => "Out",
PollFDEvent::Err => "Err",
PollFDEvent::Hup => "Hup",
PollFDEvent::Nval => "Nval",
}
)
}
}
pub enum PrivateReadPixelsFlags {
NoFlip = 1 << 30,
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RendererError {
XlibDisplayOpen,
BadConstraint,
}
impl fmt::Display for RendererError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"RendererError::{}",
match *self {
RendererError::XlibDisplayOpen => "XlibDisplayOpen",
RendererError::BadConstraint => "BadConstraint",
}
)
}
}
#[derive(Debug, Clone)]
pub enum TextureLoader {
Sized {
width: u32,
height: u32,
depth: u32, },
Bitmap {
bitmap: Bitmap,
height: u32, depth: u32, can_convert_in_place: bool,
},
#[cfg(feature = "egl")]
EglImage {
image: EGLImageKHR,
width: u32,
height: u32,
format: PixelFormat,
},
GlForeign {
width: u32,
height: u32,
format: PixelFormat,
gl_handle: u32,
},
}
impl Default for TextureLoader {
fn default() -> Self {
Self::Sized {
width: 0,
height: 0,
depth: 0,
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ShaderType {
Vertex,
Fragment,
}
impl fmt::Display for ShaderType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ShaderType::{}",
match *self {
ShaderType::Vertex => "Vertex",
ShaderType::Fragment => "Fragment",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum SnippetHook {
Vertex,
VertexTransform,
VertexGlobals,
PointSize,
Fragment,
FragmentGlobals,
TextureCoordTransform,
LayerFragment,
TextureLookup,
}
impl fmt::Display for SnippetHook {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SnippetHook::{}",
match *self {
SnippetHook::Vertex => "Vertex",
SnippetHook::VertexTransform => "VertexTransform",
SnippetHook::VertexGlobals => "VertexGlobals",
SnippetHook::PointSize => "PointSize",
SnippetHook::Fragment => "Fragment",
SnippetHook::FragmentGlobals => "FragmentGlobals",
SnippetHook::TextureCoordTransform => "TextureCoordTransform",
SnippetHook::LayerFragment => "LayerFragment",
SnippetHook::TextureLookup => "TextureLookup",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum StereoMode {
None,
Both,
Left,
Right,
}
impl Default for StereoMode {
fn default() -> Self {
Self::None
}
}
impl fmt::Display for StereoMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"StereoMode::{}",
match *self {
StereoMode::None => "None",
StereoMode::Both => "Both",
StereoMode::Left => "Left",
StereoMode::Right => "Right",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum SubpixelOrder {
Unknown,
None,
HorizontalRgb,
HorizontalBgr,
VerticalRgb,
VerticalBgr,
}
impl Default for SubpixelOrder {
fn default() -> Self {
Self::Unknown
}
}
impl fmt::Display for SubpixelOrder {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SubpixelOrder::{}",
match *self {
SubpixelOrder::Unknown => "Unknown",
SubpixelOrder::None => "None",
SubpixelOrder::HorizontalRgb => "HorizontalRgb",
SubpixelOrder::HorizontalBgr => "HorizontalBgr",
SubpixelOrder::VerticalRgb => "VerticalRgb",
SubpixelOrder::VerticalBgr => "VerticalBgr",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum SystemError {
SystemErrorUnsupported,
SystemErrorNoMemory,
}
impl fmt::Display for SystemError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SystemError::{}",
match *self {
SystemError::SystemErrorUnsupported => "SystemErrorUnsupported",
SystemError::SystemErrorNoMemory => "SystemErrorNoMemory",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TextureComponents {
A,
Rg,
Rgb,
Rgba,
Depth,
}
impl fmt::Display for TextureComponents {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TextureComponents::{}",
match *self {
TextureComponents::A => "A",
TextureComponents::Rg => "Rg",
TextureComponents::Rgb => "Rgb",
TextureComponents::Rgba => "Rgba",
TextureComponents::Depth => "Depth",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TextureError {
Size,
Format,
BadParameter,
Type,
}
impl fmt::Display for TextureError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TextureError::{}",
match *self {
TextureError::Size => "Size",
TextureError::Format => "Format",
TextureError::BadParameter => "BadParameter",
TextureError::Type => "Type",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TexturePixmapX11Error {
TexturePixmapX11ErrorX11,
}
impl fmt::Display for TexturePixmapX11Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TexturePixmapX11Error::{}",
match *self {
TexturePixmapX11Error::TexturePixmapX11ErrorX11 => "TexturePixmapX11ErrorX11",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TexturePixmapX11ReportLevel {
RawRectangles,
DeltaRectangles,
BoundingBox,
NonEmpty,
}
impl fmt::Display for TexturePixmapX11ReportLevel {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TexturePixmapX11ReportLevel::{}",
match *self {
TexturePixmapX11ReportLevel::RawRectangles => "RawRectangles",
TexturePixmapX11ReportLevel::DeltaRectangles => "DeltaRectangles",
TexturePixmapX11ReportLevel::BoundingBox => "BoundingBox",
TexturePixmapX11ReportLevel::NonEmpty => "NonEmpty",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TextureType {
_2d,
_3d,
Rectangle,
}
impl fmt::Display for TextureType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TextureType::{}",
match *self {
TextureType::_2d => "_2d",
TextureType::_3d => "_3d",
TextureType::Rectangle => "Rectangle",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum VerticesMode {
Points,
Lines,
LineLoop,
LineStrip,
Triangles,
TriangleStrip,
TriangleFan,
}
impl fmt::Display for VerticesMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"VerticesMode::{}",
match *self {
VerticesMode::Points => "Points",
VerticesMode::Lines => "Lines",
VerticesMode::LineLoop => "LineLoop",
VerticesMode::LineStrip => "LineStrip",
VerticesMode::Triangles => "Triangles",
VerticesMode::TriangleStrip => "TriangleStrip",
VerticesMode::TriangleFan => "TriangleFan",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum Winding {
Clockwise,
CounterClockwise,
}
impl fmt::Display for Winding {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"Winding::{}",
match *self {
Winding::Clockwise => "Clockwise",
Winding::CounterClockwise => "CounterClockwise",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum WinsysFeature {
MultipleOnscreen,
SwapThrottle,
VblankCounter,
VblankWait,
TextureFromPixmap,
SwapBuffersEvent,
SwapRegion,
SwapRegionThrottle,
SwapRegionSynchronized,
BufferAge,
SyncAndCompleteEvent,
NFeatures,
}
impl fmt::Display for WinsysFeature {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"WinsysFeature::{}",
match *self {
WinsysFeature::MultipleOnscreen => "MultipleOnscreen",
WinsysFeature::SwapThrottle => "SwapThrottle",
WinsysFeature::VblankCounter => "VblankCounter",
WinsysFeature::VblankWait => "VblankWait",
WinsysFeature::TextureFromPixmap => "TextureFromPixmap",
WinsysFeature::SwapBuffersEvent => "SwapBuffersEvent",
WinsysFeature::SwapRegion => "SwapRegion",
WinsysFeature::SwapRegionThrottle => "SwapRegionThrottle",
WinsysFeature::SwapRegionSynchronized => "SwapRegionSynchronized",
WinsysFeature::BufferAge => "BufferAge",
WinsysFeature::SyncAndCompleteEvent => "SyncAndCompleteEvent",
WinsysFeature::NFeatures => "NFeatures",
}
)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum WinsysID {
Any,
Stub,
Glx,
EglXlib,
EglNull,
EglGdl,
EglWayland,
EglKms,
EglAndroid,
EglMir,
Wgl,
Sdl,
}
impl fmt::Display for WinsysID {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"WinsysID::{}",
match *self {
WinsysID::Any => "Any",
WinsysID::Stub => "Stub",
WinsysID::Glx => "Glx",
WinsysID::EglXlib => "EglXlib",
WinsysID::EglNull => "EglNull",
WinsysID::EglGdl => "EglGdl",
WinsysID::EglWayland => "EglWayland",
WinsysID::EglKms => "EglKms",
WinsysID::EglAndroid => "EglAndroid",
WinsysID::EglMir => "EglMir",
WinsysID::Wgl => "Wgl",
WinsysID::Sdl => "Sdl",
}
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum Usage {
Dynamic,
Static,
}
impl Default for Usage {
fn default() -> Self {
Self::Static
}
}