I'm attempting to use double-buffering to drag a chess piece on a chessboard. Once having drawn a piece on the board in memory, a texture must be created to have the piston window event loop display the board.
In the following event loop code, is the update event the appropriate place to create a new texture? Is that the intent of the update event?
let mut cot_app = CotApp::new();
cot_app.on_load(&mut window);
while let Some(event) = window.next() {
match event {
Event::Loop(Loop::Update(ref upd)) => cot_app.on_update(upd),
Event::Loop(Loop::Render(ref ren)) => cot_app.on_draw(ren, &mut window, &event),
Event::Input(ref inp, _) => cot_app.on_input(inp),
_ => {}
}
}