Skip to content

Commit

Permalink
Change 'Run' to 'Reset'
Browse files Browse the repository at this point in the history
  • Loading branch information
jrprice committed Oct 8, 2021
1 parent 958e0e0 commit 70775e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<option value="1">1</option>
</select>
<br />
<button id="run">Run</button>
<button id="reset">Reset</button>
<button id="pause">Pause</button>
</div>
<div>
Expand Down
6 changes: 3 additions & 3 deletions src/nbody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ function draw() {
requestAnimationFrame(draw);
}

const run = async () => {
const reset = async () => {
// Make sure WebGPU device has been created.
if (device == null) {
await init();
Expand All @@ -297,10 +297,10 @@ function pause() {
document.getElementById("pause").innerText = paused ? 'Unpause' : 'Pause';
}

run();
reset();

// Set up button onclick handlers.
document.querySelector('#run').addEventListener('click', run);
document.querySelector('#reset').addEventListener('click', reset);
document.querySelector('#pause').addEventListener('click', pause);

// Add an event handler to update render parameters when the window is resized.
Expand Down

0 comments on commit 70775e8

Please sign in to comment.