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
#![doc = include_str!("../README.md")]
#![warn(
    anonymous_parameters,
    bare_trait_objects,
    deprecated_in_future,
    ellipsis_inclusive_range_patterns,
    future_incompatible,
    missing_copy_implementations,
    missing_debug_implementations,
    missing_docs,
    nonstandard_style,
    rust_2018_compatibility,
    rust_2018_idioms,
    rust_2021_compatibility,
    rustdoc::bare_urls,
    rustdoc::broken_intra_doc_links,
    rustdoc::invalid_html_tags,
    rustdoc::invalid_rust_codeblocks,
    rustdoc::private_intra_doc_links,
    single_use_lifetimes,
    trivial_casts,
    trivial_numeric_casts,
    unreachable_pub,
    unused,
    variant_size_differences
)]
#![doc(
    html_root_url = "https://docs.rs/pix-engine/0.3.5",
    html_favicon_url = "",
    html_logo_url = ""
)]

#[macro_use]
pub mod color;
pub mod appstate;
pub mod draw;
pub mod engine;
pub mod error;
#[macro_use]
pub mod shape;
pub mod audio;
pub mod event;
pub mod graphics;
pub mod image;
pub mod ops;
pub mod state;
pub mod texture;
pub mod window;
#[macro_use]
pub mod math;
#[macro_use]
pub mod vector;
pub mod gui;
pub mod renderer;
#[cfg(feature = "serde")]
pub mod serialize;
pub mod transform;

mod utils;

/// Exports most commonly used types, traits, and functions.
pub mod prelude {
    use super::*;

    pub use appstate::AppState;
    pub use color::{Color, Mode as ColorMode};
    pub use draw::Draw;
    pub use engine::PixEngine;
    pub use error::{Error as PixError, Result as PixResult};
    pub use event::{
        Axis, ControllerButton, ControllerEvent, ControllerId, ControllerUpdate, Event, HatState,
        Key, KeyEvent, KeyMod, Mouse, WindowEvent,
    };
    pub use graphics::lighting::{Light, LightSource};
    pub use gui::theme::{self, ColorType, Font, Theme};
    pub use image::{Image, PixelFormat};
    pub use math::{map, random_rng, Float, Num, Scalar};
    pub use shape::{Contains, Ellipse, Intersects, Line, Point, PointI2, Quad, Rect, Sphere, Tri};
    pub use state::{
        settings::{
            AngleMode, ArcMode, BlendMode, DrawMode, EllipseMode, FontStyle, ImageMode, RectMode,
        },
        PixState,
    };
    pub use texture::TextureId;
    pub use transform::Flipped;
    pub use vector::Vector;
    pub use window::{Cursor, Position, SystemCursor, WindowBuilder, WindowId};

    // Shape macros
    pub use {circle, ellipse, line_, point, quad, rect, sphere, square, tri};
    // Math macros
    pub use {noise, random, vector};
    // Color macros
    pub use {color, hsb, hsl, rgb};
}