1#![crate_type = "lib"]
2#![crate_name = "shura"]
3
4pub const VERSION: &str = env!("CARGO_PKG_VERSION");
6
7mod component;
8mod data;
9mod graphics;
10mod input;
11mod math;
12mod scene;
13mod shura;
14mod state;
15
16pub use instant::Duration;
17pub use rustc_hash::{FxHashMap, FxHashSet};
18pub use shura_proc::*;
19
20#[cfg(target_os = "android")]
21pub use ::winit::platform::android::activity::AndroidApp;
22
23pub(crate) use data::arena::*;
24
25pub use crate::{
26 component::{
27 component_config::*, component_derive::*, component_handle::*, component_manager::*,
28 component_set::*, component_type::*, empty_component::*, group::*, position_component::*,
29 },
30 graphics::{
31 camera::*, color::*, frame_manager::*, gpu::*, instance_buffer::*, model::*,
32 render_encoder::*, render_target::*, renderer::*, screen_config::*, shader::*, sprite::*,
33 sprite_sheet::*, uniform::*, vertex::*,
34 },
35 input::input::{Input, InputEvent, InputTrigger, Key, Modifier, MouseButton, ScreenTouch},
36 math::{aabb::*, math::*},
37 scene::{context::Context, scene::*, scene_manager::*},
38 shura::*,
39 state::{state::*, state_manager::*},
40};
41
42pub mod wgpu {
44 pub use wgpu::*;
45}
46
47pub mod winit {
49 pub use winit::*;
50}
51
52#[cfg(feature = "audio")]
54mod sound;
55#[cfg(feature = "audio")]
56pub mod audio {
58 pub use crate::sound::audio_manager::*;
59 pub use crate::sound::sound::*;
60 pub use rodio::Sink as AudioSink;
61 pub use rodio::*;
62}
63
64pub mod image {
66 pub use image::*;
67}
68
69pub mod bytmuck {
70 pub use bytemuck::*;
71}
72
73#[cfg(feature = "physics")]
75mod world;
76#[cfg(feature = "physics")]
77pub mod physics {
79 pub(crate) use crate::world::world_changes::*;
80 pub use crate::world::{collider_component::*, rigid_body_component::*, world::*};
81 pub use rapier2d::geometry::*;
82 pub use rapier2d::parry;
83 pub use rapier2d::prelude::{
84 ActiveCollisionTypes, ActiveEvents, ActiveHooks, CoefficientCombineRule, Collider,
85 ColliderBroadPhaseData, ColliderBuilder, ColliderChanges, ColliderFlags, ColliderHandle,
86 ColliderMaterial, ColliderParent, ColliderSet, ColliderShape, ColliderType, FixedJoint,
87 FixedJointBuilder, GenericJoint, GenericJointBuilder, Group, ImpulseJoint,
88 ImpulseJointHandle, InteractionGroups, LockedAxes, MassProperties, MotorModel,
89 PrismaticJoint, QueryFilter, QueryFilterFlags, Ray, RayIntersection, RevoluteJoint,
90 RevoluteJointBuilder, RigidBody, RigidBodyActivation, RigidBodyBuilder, RigidBodyHandle,
91 RigidBodySet, RigidBodyType, Shape, ShapeType, SharedShape, SpacialVector, TypedShape, TOI,
92 };
93 pub mod rapier {
94 pub use rapier2d::*;
95 }
96}
97
98#[cfg(feature = "gui")]
100pub mod gui {
102 pub(crate) use crate::graphics::gui::gui::*;
103 pub use egui::Context as GuiContext;
104 pub use egui::*;
105}
106
107#[cfg(feature = "text")]
109pub mod text {
111 pub use crate::graphics::text::{font::*, text::*, text_pipeline::*};
112 pub use glyph_brush::{
113 BuiltInLineBreaker, FontId, GlyphCruncher, HorizontalAlign, Layout, LineBreak,
114 OwnedSection, OwnedText, Section, SectionGlyphIter, SectionText, Text, VerticalAlign,
115 };
116}
117
118#[cfg(feature = "gamepad")]
120pub mod gamepad {
122 pub use crate::input::input::{GamepadButton, GamepadStick};
123 pub use gilrs::{
124 ev, ff, Axis, Button, ConnectedGamepadsIterator, Gamepad, GamepadId, Mapping, MappingError,
125 MappingSource, PowerInfo,
126 };
127}
128
129#[cfg(feature = "serde")]
131pub use crate::scene::scene_serde::*;
132
133#[cfg(feature = "animation")]
135mod tween;
136#[cfg(feature = "animation")]
138pub mod animation {
139 pub use crate::tween::{ease::*, tween::*};
140}
141
142pub mod na {
144 pub use nalgebra::*;
145}
146
147pub mod mint {
149 pub use mint::*;
150}
151
152pub mod rand {
154 pub fn gen_range<
155 T: distributions::uniform::SampleUniform,
156 R: distributions::uniform::SampleRange<T>,
157 >(
158 range: R,
159 ) -> T {
160 return thread_rng().gen_range(range);
161 }
162 pub fn gen_bool(p: f64) -> bool {
163 return thread_rng().gen_bool(p);
164 }
165
166 pub use rand::*;
167}
168
169#[cfg(feature = "log")]
170mod logging;
171
172#[cfg(feature = "log")]
173pub mod log {
175 pub use crate::logging::logging::LoggerBuilder;
176 pub use log::{debug, error, info, trace, warn, Level, LevelFilter, SetLoggerError};
177 pub mod env_logger {
178 pub use env_logger::*;
179 }
180}