Zheoni / bevy_pixel_buffer

A library to draw pixels in bevy
MIT License
40 stars 7 forks source link

The pixel buffer with a attached compute shader is never rendered when setting pixel buffer size #11

Closed crillon closed 9 months ago

crillon commented 9 months ago

Code like this leads to this problem:

fn update(
    mut pb: QueryPixelBuffer,
    mut egui_context: EguiContexts,
) {
    egui::CentralPanel::default().show(egui_context.ctx_mut(), |ui| {
        pb.update_fill_egui(ui.available_size());
        // or even this: pb.update_fill_egui(egui::Vec2::new(512.0, 512.0));

        let texture = pb.egui_texture();

        ui.image(egui::load::SizedTexture::new(texture.id, texture.size));
    });
}