aboutsummaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-04-16 23:14:06 +0200
committerAdrian Kummerlaender2019-04-16 23:14:06 +0200
commite40114aad7fb5665c97c1b048515f0443cda5700 (patch)
treede2378756b1c2a6833c5e4a5bbcca9fa57f44b5d /src/main.cc
parentfc02e4c5f8c8bbb014449dc27d7b69992ad6043f (diff)
downloadcompustream-e40114aad7fb5665c97c1b048515f0443cda5700.tar
compustream-e40114aad7fb5665c97c1b048515f0443cda5700.tar.gz
compustream-e40114aad7fb5665c97c1b048515f0443cda5700.tar.bz2
compustream-e40114aad7fb5665c97c1b048515f0443cda5700.tar.lz
compustream-e40114aad7fb5665c97c1b048515f0443cda5700.tar.xz
compustream-e40114aad7fb5665c97c1b048515f0443cda5700.tar.zst
compustream-e40114aad7fb5665c97c1b048515f0443cda5700.zip
Add flag to toggle fluid quality display
e.g. check out `./compustream --size 512 128 --open --lups 300 --quality`
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.cc b/src/main.cc
index 5df6892..5c27306 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -26,7 +26,8 @@
GLuint maxLUPS = 100;
GLuint nX = 512;
GLuint nY = 256;
-bool open_boundaries = false;
+bool open_boundaries = false;
+bool show_fluid_quality = false;
float getWorldHeight(int window_width, int window_height, float world_width) {
return world_width / window_width * window_height;
@@ -199,6 +200,7 @@ int render() {
{
auto guard = collide_shader->use();
+ collide_shader->setUniform("fluidQuality", show_fluid_quality);
collide_shader->setUniform("iT", iT);
iT += 1;
@@ -215,6 +217,7 @@ int render() {
scene_shader->setUniform("MVP", MVP);
scene_shader->setUniform("nX", nX);
scene_shader->setUniform("nY", nY);
+ scene_shader->setUniform("fluidQuality", show_fluid_quality);
glClear(GL_COLOR_BUFFER_BIT);
fluid->draw();
@@ -267,6 +270,10 @@ bool parseArguments(int argc, char* argv[]) {
if ( arg == "--open" ) {
open_boundaries = true;
}
+
+ if ( arg == "--quality" ) {
+ show_fluid_quality = true;
+ }
}
return true;
}