pigeon_parrot/
lib.rs

1//! # Parrot
2//! A repeated middleware layer
3//! 
4//! ## About
5//! Parrot is more or less a re-implementation of [easygpu](https://github.com/khonsulabs/easygpu) for pigeon. Hence its development is primarily driven by the demands of pigeon. It deals with some of the boilerplate code that comes with [wgpu](https://crates.io/crates/wgpu) and provides various wrappers around [wgpu's](https://crates.io/crates/wgpu) types so they are easier to work with, while still giving you control. Parrot isn't magic and requires you understand wgpu well enough to be used properly.
6//! 
7//! ## Usage
8//! Before using parrot I recommend reading [learn wgpu](https://sotrh.github.io/learn-wgpu/#what-is-wgpu) as it's an excellent resource to get you aquainted with wgpu and how it works. As a basic setup you will create a wgpu instance and a window using winit and then a Painter. From there it is up to you.
9//! ```rust
10//! fn main() {
11//!     // Initialise the logging output at info level only from parrot
12//!     env_logger::builder().filter_module("pigeon_parrot", log::LevelFilter::Info).init();
13//!     // Create an event loop
14//!     let event_loop = winit::event_loop::EventLoop::new();
15//!     // Create a window to draw to
16//!     let window = winit::window::WindowBuilder::new().with_title("Triangle :D").build(&event_loop).unwrap();
17//!     // Create a wgpu instance
18//!     let instance = wgpu::Instance::new(wgpu::Backends::GL);
19//!     let surface = unsafe { instance.create_surface(&window) };
20//!     // Create the painter
21//!     let mut painter = pollster::block_on(parrot::Painter::for_surface(surface, &instance, 1)).unwrap();
22//!     // Get the size of the window
23//!     let winsize = window.inner_size();
24//!     // Get the preferred texture format for the surface
25//!    let pref_format = painter.preferred_format();
26//!     // Configure the surface
27//!     painter.configure(euclid::Size2D::new(winsize.width, winsize.height), wgpu::PresentMode::Fifo, pref_format);
28//!     // ...
29//! }
30//! ```
31//! I have created some examples (in the examples folder) that demonstrate parrots capabilities and will hopefully give you an idea of how to use parrot. To run them use `cargo run --example=ExampleNameHere`
32
33pub mod painter;
34pub mod pipeline;
35pub mod binding;
36pub mod shader;
37pub mod device;
38pub mod transform;
39pub mod vertex;
40pub mod buffers;
41pub mod texture;
42pub mod sampler;
43pub mod color;
44pub mod error;
45pub mod frame;
46
47pub use pipeline::{Plumber, PipelineCore, PipelineDescription};
48pub use painter::{RenderPassExtention, Painter};
49pub use texture::Texture;
50pub use sampler::Sampler;
51pub use buffers::*;
52pub use color::*;
53pub use device::Device;