macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

build_textures_atlas causes broken textures / flickering

Open ollej opened this issue 2 years ago • 0 comments

Since after the commit 8ef3abff6be5c1dab6cff94b9c0a65f30f7ca148 it seems that using the function build_textures_atlas() breaks textures. They flicker and have broken content.

This short example causes the issue:

use macroquad::prelude::*;

#[macroquad::main("Flicker test")]
async fn main() {
    let texture: Texture2D = load_texture("assets/texture.png").await.unwrap();
    build_textures_atlas();

    loop {
        clear_background(BLACK);
        draw_texture(
            &texture,
            screen_width() / 2.0 - texture.width(),
            screen_height() / 2.0 - texture.height(),
            WHITE,
        );
        next_frame().await
    }
}

Removing the call to build_textures_atlas() solves the issue.

ollej avatar Oct 15 '23 16:10 ollej