Ajout du support du multi-GPU pour Mandelbrot.
[GPU.git] / WCudaMSE / Student_Cuda_Image / src / cpp / core / mainGL.cpp
index fe29a86..b15ca7b 100755 (executable)
@@ -19,19 +19,25 @@ template <class TOutput, class TProvider>
 class Viewer\r
     {\r
     private:\r
-        TOutput* ptrProvider;\r
+        TOutput* ptrOutput;\r
         GLUTImageViewers viewer;\r
 \r
     public:\r
         Viewer(bool isAnimation, bool isSelection, int pxFrame, int pyFrame):\r
-            ptrProvider(TProvider::createGL()),\r
-            viewer(ptrProvider, isAnimation, isSelection, pxFrame, pyFrame)\r
+        ptrOutput(TProvider::createGL()),\r
+            viewer(ptrOutput, isAnimation, isSelection, pxFrame, pyFrame)\r
+            {\r
+            }\r
+\r
+        Viewer(TOutput* output, bool isAnimation, bool isSelection, int pxFrame, int pyFrame):\r
+            ptrOutput(output),\r
+            viewer(ptrOutput, isAnimation, isSelection, pxFrame, pyFrame)\r
             {\r
             }\r
 \r
         ~Viewer()\r
             {\r
-            delete this->ptrProvider;\r
+            delete this->ptrOutput;\r
             }\r
     };\r
 \r
@@ -39,13 +45,13 @@ int mainGL(void)
     {\r
     // Viewer<Rippling0Image, Rippling0Provider> rippling0(true, true, 10, 10);\r
     // Viewer<Image, RipplingProvider> rippling0(true, true, 10, 10);\r
-    Viewer<ImageFonctionel, MandelbrotProvider> fractalMandelbrot(true, true, 20, 20);\r
+    Viewer<ImageFonctionel, MandelbrotProvider> fractalMandelbrot(MandelbrotProvider::createGL(true), true, true, 20, 20);\r
     // Viewer<ImageFonctionel, JuliaProvider> fractalJulia(true, true, 30, 30);\r
     // Viewer<ImageFonctionel, NewtonProvider> newtown(true, true, 20, 20);\r
     // Viewer<Image, HeatTransfertProvider> heatTransfert(true, false, 20, 20);\r
     // Viewer<ImageFonctionel, RayTracingProvider> rayTracing(true, true, 20, 20);\r
 \r
-    GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte\r
+    GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte.\r
 \r
     return EXIT_SUCCESS;\r
     }\r