]> git.treefish.org Git - seamulator.git/blobdiff - src/seamulator.cpp
make some noise
[seamulator.git] / src / seamulator.cpp
index 42111091113a0a384c7427a540f83d923d0c3417..aec8da13377c6053d2a865c84c4b8e31a70a4a89 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "sea.h"
 #include "seaview.h"
 
 #include "sea.h"
 #include "seaview.h"
+#include "synthesizer.h"
 #include "watersurface.h"
 
 const int INIT_WINDOW_POS_X{50};
 #include "watersurface.h"
 
 const int INIT_WINDOW_POS_X{50};
@@ -40,6 +41,7 @@ const char WINDOW_TITLE[]{"seamulator"};
 SeaPtr sea;
 WaterSurfacePtr surface;
 std::unique_ptr<SeaView> seaView;
 SeaPtr sea;
 WaterSurfacePtr surface;
 std::unique_ptr<SeaView> seaView;
+std::unique_ptr<Synthesizer> synthesizer;
 
 struct Settings {
   double windSpeed;
 
 struct Settings {
   double windSpeed;
@@ -62,13 +64,14 @@ int main(int argc, char** argv)
 
   std::srand(std::time(0));
   surface = std::make_shared<WaterSurface>(settings.latticeSize,
 
   std::srand(std::time(0));
   surface = std::make_shared<WaterSurface>(settings.latticeSize,
-                                          settings.latticeExtend);
+                                           settings.latticeExtend);
   sea = std::make_shared<Sea>(surface,
   sea = std::make_shared<Sea>(surface,
-                             settings.windSpeed,
-                             settings.amplitudeFactor);
+                              settings.windSpeed,
+                              settings.amplitudeFactor);
   seaView = std::make_unique<SeaView>(settings.latticeExtend * 1.5,
   seaView = std::make_unique<SeaView>(settings.latticeExtend * 1.5,
-                                     INIT_VIEW_AZIMUTH,
-                                     INIT_VIEW_ALTITUDE);
+                                      INIT_VIEW_AZIMUTH,
+                                      INIT_VIEW_ALTITUDE);
+  synthesizer = std::make_unique<Synthesizer>(surface);
 
   glutInit(&argc, argv);
   glutInitDisplayMode(GLUT_DOUBLE);
 
   glutInit(&argc, argv);
   glutInitDisplayMode(GLUT_DOUBLE);
@@ -134,6 +137,7 @@ void glDisplayFunc()
   seaView->setupView();
   sea->update();
   surface->draw();
   seaView->setupView();
   sea->update();
   surface->draw();
+  synthesizer->tick();
 
   glutSwapBuffers();
   glutPostRedisplay();
 
   glutSwapBuffers();
   glutPostRedisplay();