Open yaymukund opened 8 months ago
When textures are rendered, there is a placeholder image that flashes for a single frame before the actual image. Here is an example of how it looks:
Example reproduction:
impl GameLoop for Game { fn new(_c: &mut EngineState) -> Self { load_multiple_textures( // Includes the "monkey" texture. crate::constants::TEXTURES .iter() .map(|(a, b)| (a.to_string(), b.to_string())) .collect_vec(), ); clear_background(BLACK); Self } fn update(&mut self, c: &mut EngineContext) { if assets_loaded() < assets_queued_total() { println!("{}/{} loaded", assets_loaded(), assets_queued_total()); return; } draw_sprite( texture_id("monkey"), vec2(5.0, 0.0), WHITE, 0, vec2(2.60, 3.15), ); } }
Here's my attempt to track it down:
run_early_update_stages()
inc_assets_loaded()
Fix in this branch. We just put off the rendering by 1 frame.
This doesn't seem to fix things for Sprite::new
Sprite::new
When textures are rendered, there is a placeholder image that flashes for a single frame before the actual image. Here is an example of how it looks:
Example reproduction:
Here's my attempt to track it down:
run_early_update_stages()
processes the asset queues...inc_assets_loaded()
saying it is "loaded." It is not actually loaded yet.Fix in this branch. We just put off the rendering by 1 frame.