Expand description
Astrelis - A modular game engine
Astrelis is a Rust game engine built around a flexible plugin system. It provides core functionality for game development including:
- Plugin System: Extensible architecture for adding features
- Asset Management: Type-safe asset loading and caching
- Rendering: GPU-accelerated rendering with wgpu
- Text Rendering: High-quality text with cosmic-text
- Input Handling: Keyboard, mouse, and gamepad input
- Windowing: Cross-platform window management
§Quick Start
ⓘ
use astrelis::prelude::*;
struct MyGame {
engine: Engine,
}
impl App for MyGame {
fn render(&mut self, ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
// Game logic here
}
}
fn main() {
run_app(|ctx| {
let window = ctx.create_window(WindowDescriptor::default()).unwrap();
let engine = Engine::new()
.add_plugin(AssetPlugin)
.add_plugin(RenderPlugin)
.build();
Box::new(MyGame { engine })
});
}§Architecture
The engine is built around the Plugin trait, which allows adding
functionality in a modular way. Plugins can:
- Register resources with the engine
- Hook into the update and render lifecycle
- Depend on other plugins
§Default Plugins
AssetPlugin- Asset loading and managementRenderPlugin- Graphics context and rendering (requires window)TextPlugin- Text rendering capabilitiesInputPlugin- Input state management
Re-exports§
pub use application::ApplicationBuilder;pub use engine::Engine;pub use engine::EngineBuilder;pub use engine::EngineError;pub use plugin::FnPlugin;pub use plugin::Plugin;pub use plugin::PluginGroup;pub use resource::Resource;pub use resource::Resources;pub use task_pool::TaskPool;pub use time::Time;pub use plugins::AssetPlugin;pub use plugins::AsyncRuntimePlugin;pub use plugins::RenderContexts;pub use plugins::RenderPlugin;pub use plugins::TextPlugin;pub use plugins::InputPlugin;pub use plugins::TimePlugin;pub use plugins::DefaultPlugins;pub use plugins::MinimalPlugins;pub use astrelis_core as core;pub use astrelis_winit as winit;pub use astrelis_assets as assets;pub use astrelis_render as render;pub use astrelis_text as text;pub use astrelis_input as input;
Modules§
- application
- High-level application builder for simplified game/app initialization.
- engine
- Engine core - manages plugins and resources.
- math
- plugin
- Plugin system for extending engine functionality.
- plugins
- Default plugins for the Astrelis engine.
- prelude
- Prelude module for convenient imports
- resource
- Resource management for the engine.
- task_
pool - Async task execution pool.
- time
Structs§
- AppCtx
- Event
Batch - Handle
Status - Window
- Window
Descriptor - Window
Id - Identifier of a window. Unique for each window.
Enums§
Traits§
Functions§
- run_app
- Run the application with the given factory function.