Skip to main content

goud_engine/
lib.rs

1#![warn(missing_docs)]
2#![warn(rustdoc::all)]
3#![allow(rustdoc::private_intra_doc_links)]
4// Allow common lint warnings in test code
5#![cfg_attr(test, allow(dead_code))]
6#![cfg_attr(test, allow(unused_variables))]
7#![cfg_attr(test, allow(unused_mut))]
8#![cfg_attr(test, allow(unused_unsafe))]
9#![cfg_attr(test, allow(unused_assignments))]
10#![cfg_attr(test, allow(clippy::useless_vec))]
11#![cfg_attr(test, allow(clippy::unnecessary_unwrap))]
12#![cfg_attr(test, allow(clippy::approx_constant))]
13#![cfg_attr(test, allow(clippy::clone_on_copy))]
14#![cfg_attr(test, allow(clippy::unnecessary_cast))]
15#![cfg_attr(test, allow(clippy::unit_cmp))]
16#![cfg_attr(test, allow(clippy::drop_non_drop))]
17#![cfg_attr(test, allow(clippy::bool_assert_comparison))]
18#![cfg_attr(test, allow(clippy::manual_range_contains))]
19#![cfg_attr(test, allow(clippy::single_char_add_str))]
20#![cfg_attr(test, allow(clippy::len_zero))]
21#![cfg_attr(test, allow(clippy::cmp_owned))]
22#![cfg_attr(test, allow(clippy::assertions_on_constants))]
23#![cfg_attr(test, allow(clippy::default_constructed_unit_structs))]
24#![cfg_attr(test, allow(clippy::field_reassign_with_default))]
25
26//! # Goud Engine Core
27//!
28//! This is the core library for the Goud Engine, a lightweight, cross-platform,
29//! and data-oriented game engine written in Rust. It provides a flexible
30//! Entity-Component-System (ECS) architecture, rendering abstractions, asset
31//! management, and an FFI layer for scripting in other languages like C#.
32//!
33//! ## Key Modules
34//!
35//! - [`core`]: Foundational building blocks like error handling, generational
36//!   handles, events, and math types.
37//! - [`ecs`]: A full-featured, Bevy-inspired Entity-Component-System. This is
38//!   the primary interface for game development.
39//! - [`assets`]: A comprehensive asset management system with hot-reloading.
40//! - [`ffi`]: The Foreign Function Interface for C# and other language bindings.
41//! - [`libs`]: Low-level libraries, currently containing the graphics backend.
42
43pub mod assets;
44/// Type-erased component operations shared by FFI and SDK layers.
45pub mod component_ops;
46/// Engine context management (isolated World instances).
47pub mod context_registry;
48pub mod core;
49pub mod ecs;
50#[cfg(feature = "native")]
51pub mod ffi;
52/// Low-level libraries for graphics, platform, and other systems.
53pub mod libs;
54/// High-level rendering systems (sprite batching) bridging ECS, assets, and graphics.
55pub mod rendering;
56/// High-level Rust-native SDK for game development.
57///
58/// This module provides an ergonomic, zero-overhead API for building games
59/// in pure Rust. Unlike the FFI layer, the SDK is designed for Rust developers
60/// with full type safety and idiomatic APIs.
61///
62/// # Example
63///
64/// ```rust
65/// use goud_engine::sdk::{GoudGame, GameConfig};
66/// use goud_engine::sdk::components::Transform2D;
67/// use goud_engine::core::math::Vec2;
68///
69/// let mut game = GoudGame::new(GameConfig::default()).unwrap();
70/// let player = game.spawn()
71///     .with(Transform2D::from_position(Vec2::new(100.0, 100.0)))
72///     .build();
73/// ```
74pub mod sdk;
75/// Test helpers for GPU-free testing.
76#[cfg(any(test, feature = "headless"))]
77pub mod test_helpers;
78/// WebAssembly bindings for browser-based game development.
79///
80/// Exposes the engine's ECS, input, and timing through `wasm-bindgen`
81/// for consumption by the TypeScript web SDK.
82#[cfg(all(feature = "web", target_arch = "wasm32"))]
83pub mod wasm;