astrelis 0.2.4

A modular 2D/3D game engine framework
Documentation

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 management
  • RenderPlugin - Graphics context and rendering (requires window)
  • TextPlugin - Text rendering capabilities
  • InputPlugin - Input state management