From 34566b28a82869cbf004d91c6d658ba71d40ed97 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 18 Apr 2019 22:15:39 +0200 Subject: Bind key to reset lattice buffers i.e. restarting the simulation without clearing the geometry --- src/main.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main.cc') diff --git a/src/main.cc b/src/main.cc index c69bbe1..f3f14ec 100644 --- a/src/main.cc +++ b/src/main.cc @@ -105,6 +105,8 @@ int render() { return -1; } + auto reset_key = window.getKeyWatcher(GLFW_KEY_R); + auto pause_key = window.getKeyWatcher(GLFW_KEY_SPACE); bool update_lattice = true; @@ -135,6 +137,11 @@ int render() { bool tick = true; window.render([&](bool window_size_changed) { + if ( reset_key.wasClicked() ) { + iT = 0; + lattice_a->init(); + lattice_b->init(); + } if ( pause_key.wasClicked() ) { update_lattice = !update_lattice; } -- cgit v1.2.3