blue_engine_core/prelude/
imports.rs

1pub use downcast;
2pub use glam;
3pub use image;
4pub use wgpu;
5#[cfg(all(feature = "window", not(feature = "headless")))]
6pub use winit;
7
8pub use wgpu::Backends;
9pub use wgpu::CommandEncoder;
10pub use wgpu::LoadOp;
11pub use wgpu::MemoryHints;
12pub use wgpu::Operations;
13pub use wgpu::RenderPassColorAttachment;
14pub use wgpu::RenderPassDescriptor;
15pub use wgpu::TextureView;
16
17#[cfg(all(feature = "window", not(feature = "headless")))]
18pub use winit::dpi::*;
19#[cfg(all(feature = "window", not(feature = "headless")))]
20pub use winit::event::DeviceEvent;
21#[cfg(all(feature = "window", not(feature = "headless")))]
22pub use winit::event::ElementState;
23#[cfg(all(feature = "window", not(feature = "headless")))]
24pub use winit::event::Event;
25#[cfg(all(feature = "window", not(feature = "headless")))]
26pub use winit::event::KeyEvent;
27#[cfg(all(feature = "window", not(feature = "headless")))]
28pub use winit::event::MouseButton;
29#[cfg(all(feature = "window", not(feature = "headless")))]
30pub use winit::event::WindowEvent;
31#[cfg(all(feature = "window", not(feature = "headless")))]
32pub use winit::event_loop::EventLoop;
33#[cfg(all(feature = "window", not(feature = "headless")))]
34pub use winit::keyboard::Key;
35#[cfg(all(feature = "window", not(feature = "headless")))]
36pub use winit::keyboard::KeyCode;
37#[cfg(all(feature = "window", not(feature = "headless")))]
38pub use winit::window::Fullscreen;
39
40// Math types
41/// A 2-dimensional vector.
42pub type Vector2 = glam::Vec2;
43/// A 3-dimensional vector.
44pub type Vector3 = glam::Vec3;
45/// A 4-dimensional vector.
46pub type Vector4 = glam::Vec4;
47/// A 2x2 column major matrix.
48///
49/// SIMD vector types are used for storage on supported platforms.
50///
51/// This type is 16 byte aligned.
52pub type Matrix2 = glam::Mat2;
53/// A 3x3 column major matrix.
54///
55/// This 3x3 matrix type features convenience methods for creating and using linear and
56/// affine transformations.
57pub type Matrix3 = glam::Mat3;
58/// A 4x4 column major matrix.
59///
60/// This 4x4 matrix type features convenience methods for creating and using affine transforms and perspective projections.
61pub type Matrix4 = glam::Mat4;
62/// A quaternion representing an orientation.
63///
64/// This quaternion is intended to be of unit length but may denormalize due to floating point "error creep" which can occur when successive quaternion operations are applied.
65///
66/// SIMD vector types are used for storage on supported platforms.
67///
68/// This type is 16 byte aligned.
69pub type Quaternion = glam::Quat;
70
71/// Input helper
72#[cfg(all(feature = "window", not(feature = "headless")))]
73pub use crate::utils::winit_input_helper::WinitInputHelper as InputHelper;
74pub use bytemuck::Pod;
75pub use bytemuck::Zeroable;
76
77/// Depth Format
78pub const DEPTH_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Depth32Float;
79/// Shaders are programs that runs on the GPU
80pub type Shaders = wgpu::RenderPipeline;
81/// Uniform Buffers are small amount of data that are sent from CPU to GPU
82pub type UniformBuffers = wgpu::BindGroup;
83/// Textures are image data that are sent to GPU to be set to a surface
84pub type Textures = wgpu::BindGroup;
85/// Primitive type the input mesh is composed of.
86pub type ShaderPrimitive = wgpu::PrimitiveTopology;
87/// Format of indices used with pipeline.
88pub type IndexFormat = wgpu::IndexFormat;
89/// Vertex winding order which classifies the "front" face of a triangle.
90pub type FrontFace = wgpu::FrontFace;
91/// Face of a vertex.
92pub type CullMode = wgpu::Face;
93/// Type of drawing mode for polygons
94pub type PolygonMode = wgpu::PolygonMode;
95/// Power Preference when choosing a physical adapter.
96pub type PowerPreference = wgpu::PowerPreference;