piston-examples icon indicating copy to clipboard operation
piston-examples copied to clipboard

jpg image shows after delay

Open aeosynth opened this issue 8 years ago • 1 comments
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?

aeosynth avatar Nov 08 '17 12:11 aeosynth

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> = ...;

bvssvni avatar Nov 08 '17 13:11 bvssvni