1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// Oliver Berzs
// https://github.com/oberzs/duku

// Duku is a Vulkan rendering engine

//! This Rust crate makes it easy to render 2D and 3D graphics.
//!
//! # Example
//!
//! ```ignore
//! use duku::Color;
//! use duku::Camera;
//! use duku::Duku;
//! use duku::Result;
//!
//! fn main() -> Result<()> {
//!     // initialize duku and OS window with a size of 500x500
//!     let (mut duku, window) = Duku::builder().build_window(500, 500).build()?;
//!
//!     // create a 3D perspective camera with an FOV of 90
//!     let mut camera = Camera::perspective_autosized(90);
//!
//!     // move the camera to some location
//!     // and make it look at the center of the world
//!     camera.transform.move_by([2.0, 1.5, -2.0]);
//!     camera.transform.look_at([0.0, 0.0, 0.0]);
//!
//!     // start up the main event loop
//!     window.main_loop(move |_| {
//!       // start drawing on the window using our camera
//!       duku.draw_on_window(Some(&camera), |target| {
//!             // set the background color to sky blue
//!             target.clear = Color::SKY_BLUE;
//!
//!             // draw a cube at the center of the world
//!             target.draw_cube();
//!         });
//!     });
//!
//!     Ok(())
//! }
//! ```
//!
//! More usage examples can be found [here](https://github.com/oberzs/duku/tree/release/examples).

#![warn(
    rust_2018_idioms,
    unused,
    future_incompatible,
    missing_docs,
    missing_doc_code_examples,
    single_use_lifetimes,
    unused_qualifications,
    clippy::missing_const_for_fn,
    clippy::unwrap_used,
    clippy::cast_lossless,
    clippy::clone_on_ref_ptr,
    clippy::cognitive_complexity,
    clippy::explicit_iter_loop,
    clippy::explicit_into_iter_loop,
    clippy::if_not_else,
    clippy::imprecise_flops,
    clippy::inefficient_to_string,
    clippy::unused_self
)]

// should be imported first
mod macros;

mod buffer;
mod device;
mod duku;
mod error;
mod features;
mod font;
mod image;
mod instance;
mod math;
mod mesh;
mod pipeline;
mod renderer;
mod resources;
mod surface;
mod vk;

// normal exports
pub use self::duku::Duku;
pub use self::duku::DukuBuilder;
pub use device::Stats;
pub use error::Error;
pub use error::Result;
pub use image::ColorSpace;
pub use image::Cubemap;
pub use image::CubemapSides;
pub use image::Filter;
pub use image::Format;
pub use image::Framebuffer;
pub use image::Mips;
pub use image::Msaa;
pub use image::Texture;
pub use image::Wrap;
pub use math::Matrix4;
pub use math::Quaternion;
pub use math::Transform;
pub use math::Vector2;
pub use math::Vector3;
pub use math::Vector4;
pub use mesh::Mesh;
pub use mesh::Model;
pub use mesh::ModelNode;
pub use pipeline::Material;
pub use pipeline::Shader;
pub use renderer::BorderMode;
pub use renderer::Camera;
pub use renderer::Color;
pub use renderer::Light;
pub use renderer::LightType;
pub use renderer::Pcf;
pub use renderer::Projection;
pub use renderer::ShapeMode;
pub use renderer::Target;
pub use resources::Handle;
pub use surface::VSync;
pub use surface::WindowHandle;

// optional feature exports
#[cfg(feature = "glsl")]
pub use features::glsl;
#[cfg(feature = "window")]
pub use features::window;