Expand description
§memkit-bevy
Bevy ECS integration for memkit.
Provides automatic frame lifecycle management, resource integration, and optional GPU memory coordination for Bevy applications.
§Features
- Automatic frame lifecycle — Frame begin/end tied to Bevy schedule
- Resource integration —
MkAllocatoras a BevyResource - System ordering — Proper allocation timing via system sets
- Optional GPU support — Enable
gpufeature for memkit-co integration - Prelude compatibility — Enable
bevy_preludefor full Bevy prelude
§Quick Start
ⓘ
use bevy::prelude::*;
use memkit_bevy::MkPlugin;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(MkPlugin::default())
.add_systems(Update, my_system)
.run();
}
fn my_system(alloc: Res<MkAllocatorRes>) {
// Frame automatically managed - allocations valid until frame end
let data = alloc.frame_alloc::<[f32; 4]>();
// ...
}§Feature Flags
bevy_prelude— Enables full Bevy prelude re-exportsgpu— Enables GPU memory coordination via memkit-co
Re-exports§
pub use MkAllocatorRes as MkAllocatorResource;
Modules§
- prelude
- Prelude module for common imports.
Structs§
- MkAllocator
Res - Bevy resource wrapping the memkit allocator.
- MkPlugin
- Memkit plugin for Bevy.
Enums§
- MkSystem
Set - System set for memkit frame lifecycle.