care_game/
lib.rs

1#![warn(missing_docs)]
2#![doc = include_str!("../readme.md")]
3
4#[cfg(feature = "compute")]
5/// Contains functions for using GPU Compute (GPGPU)
6pub mod compute;
7/// Global care configuration parameters
8pub mod config;
9/// Low-level event handling
10pub mod event;
11#[cfg(feature = "graphics")]
12/// Contains functions for rendering graphics
13pub mod graphics;
14/// Stuff for working with a keyboard.
15pub mod keyboard;
16/// Contains functions for doing various math tasks, including working with vectors
17pub mod math;
18/// Stuff for working with a mouse
19pub mod mouse;
20/// Useful structs to have imported
21pub mod prelude;
22#[cfg(feature = "window")]
23/// Contains functions for working with window(s)
24pub mod window;
25
26/// Mark a function as the care draw function.
27pub use care_macro::care_async_main as async_main;
28/// Mark a function as the care draw function.
29pub use care_macro::care_draw as draw;
30/// Mark a function as the care initialization function.
31pub use care_macro::care_init as init;
32/// Make some state for the game
33pub use care_macro::care_state as state;
34/// Mark a function as the care update function.
35pub use care_macro::care_update as update;
36
37#[doc(hidden)]
38pub use care_macro::care_main as __internal_main;
39
40/// Global care configuration struct, pass to [main] (e.g. `care::main!(Conf { .. })`),
41/// to configure the framework
42pub use config::Conf;
43
44#[cfg(feature = "graphics")]
45/// The image crate is used for loading and saving images from various formats
46pub use image;
47/// The nalgebra crate is used for vectors and matracies, have fun with math!
48pub use nalgebra;
49/// The rand crate is used to generate random numbers
50pub use rand;
51#[cfg(feature = "graphics")]
52/// The rust type crate is used internally for loading rendering ttf fonts
53pub use rusttype;
54
55/// Inserts a default main function that automatically initializes the framework, opens a window,
56/// and calls the functions marked by [init], [update] and [draw] at appropriate
57/// times
58#[macro_export]
59macro_rules! main {
60    () => {
61        $crate::main!($crate::Conf::default());
62    };
63    ($conf:expr) => {
64        $crate::__internal_main!($conf);
65    };
66}