aboutsummaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-04-18 22:15:39 +0200
committerAdrian Kummerlaender2019-04-18 22:15:39 +0200
commit34566b28a82869cbf004d91c6d658ba71d40ed97 (patch)
tree5322ec9bf7f48a96390d638d410aff0abfe21348 /src/main.cc
parent1ad4daa0289c56e3d6b896d5037002aa6b461674 (diff)
downloadcompustream-34566b28a82869cbf004d91c6d658ba71d40ed97.tar
compustream-34566b28a82869cbf004d91c6d658ba71d40ed97.tar.gz
compustream-34566b28a82869cbf004d91c6d658ba71d40ed97.tar.bz2
compustream-34566b28a82869cbf004d91c6d658ba71d40ed97.tar.lz
compustream-34566b28a82869cbf004d91c6d658ba71d40ed97.tar.xz
compustream-34566b28a82869cbf004d91c6d658ba71d40ed97.tar.zst
compustream-34566b28a82869cbf004d91c6d658ba71d40ed97.zip
Bind key to reset lattice buffers
i.e. restarting the simulation without clearing the geometry
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc7
1 files changed, 7 insertions, 0 deletions
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;
}