bevy_pixels 0.1.0

Bevy plugin that uses Pixels (a tiny pixel buffer) for rendering
docs.rs failed to build bevy_pixels-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: bevy_pixels-0.15.0

Usage

Add bevy and bevy_pixels to Cargo.toml. Be sure to disable bevy's render and bevy_wgpu features (with default-features = false) as they will conflict with rendering provided by bevy_pixels.

[dependencies]
bevy = { version = "0.5", default_features = false }
bevy_pixels = "0.1"

Add PixelsPlugin to your Bevy project.

use bevy::prelude::*;
use bevy_pixels::prelude::*;

fn main() {
    App::build()
        .add_plugins(DefaultPlugins)
        .add_plugin(PixelsPlugin)
        .add_system(main_system.system())
        .run();
}

Use PixelsResource in your systems.

fn main_system(mut pixels_resource: ResMut<PixelsResource>) {
    // Get a mutable slice for the pixel buffer
    let frame: &mut [u8] = pixels_resource.pixels.get_frame();

    // Fill frame with pixel data
    // ...
}

Bevy Version Supported

bevy bevy_pixels
0.5 0.1

Examples

Hello Bevy Pixels

This example is based off minimal-winit example from the pixels project.

cargo run --release --example minimal

minimal example

Todo

  • Add more configuration around how rendering is performed.
  • Add support for multiple windows.