piston-examples
piston-examples copied to clipboard
jpg image shows after delay
trafficstars
I modified the image example to show a 200K jpg, and running it shows first a black window for a second, and then the image on a white background. in GTK we could render the app completely before showing it, is this possible with piston?
Looking at the source code for the event loop, it seems Piston tries to render first, so this should display the image. I don't know why it shows a black window.
Have you tried swapping the window backend? The default window backend for piston_window is Glutin. You can do this:
extern crate sdl2_window; // pistoncore-sdl2_window
use sdl2_window::Sdl2Window;
let mut window: PistonWindow<Sdl2Window> = ...;