X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2FmainGL.cpp;h=13dd2db46dca34f24451d37a80e33509214bfedd;hb=f8259dce248a4411c3bc64cecb9fc268c4fd81d6;hp=d2b6adfa87016f91fc6386860b3120afeca1ac68;hpb=2d95edd9a2d09421e5eae56755bdf3105e12edf7;p=GPU.git diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp index d2b6adf..13dd2db 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp @@ -12,40 +12,55 @@ using namespace std; #include "RipplingProvider.h" #include "FractalProvider.h" #include "NewtonProvider.h" +#include "HeatTransfertProvider.h" +#include "RayTracingProvider.h" +#include "ConvolutionProvider.h" +#include "Viewer.h" -template -class Viewer +int mainGL(const vector& args) { - private: - TOutput* ptrProvider; - GLUTImageViewers viewer; - - public: - Viewer(bool isAnimation, bool isSelection, int pxFrame, int pyFrame): - ptrProvider(TProvider::createGL()), - viewer(ptrProvider, isAnimation, isSelection, pxFrame, pyFrame) - { - } - - ~Viewer() - { - delete this->ptrProvider; - } - }; - -int mainGL(void) - { - //Viewer rippling0(true, true, 10, 10); - //Viewer rippling0(true, true, 10, 10); - //Viewer fractalMandelbrot(true, true, 20, 20); - //Viewer fractalJulia(true, true, 30, 30); - - - Viewer newtown(true, true, 20, 20); + const string defaultCommand = "raytracing"; + const string command = args.size() > 0 ? args[0] : defaultCommand; + // AutoViewer rippling0(true, true, 10, 10); // Warmup. - GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte + if (command == "rippling") + { + AutoViewer rippling(true, true, 10, 10); + } + else if (command == "mandelbrot") + { + const bool multiGPU = args.size() >= 2 && args[1] == "--mp"; + Viewer fractalMandelbrot(MandelbrotProvider::createGL(multiGPU), true, true, 10, 10); + } + else if (command == "julia") + AutoViewer fractalJulia(true, true, 10, 10); + else if (command == "newton") + AutoViewer newtown(true, true, 10, 10); + else if (command == "heat-transfert") + AutoViewer heatTransfert(true, false, 10, 10); + else if (command == "raytracing") + AutoViewer rayTracing(true, true, 20, 20); + else if (command == "convolution") + { + const string videoPath = args.size() >= 2 ? args[1] : "/media/Data/Video/nasaFHD_short.avi"; // Vidéo par défaut si pas donnée en paramètre. + Viewer convolution(ConvolutionProvider::createGL(videoPath), true, true, 10, 10); + } + else if (command == "demo") + { + Viewer convolution(ConvolutionProvider::createGL("/media/Data/Video/nasaFHD_short.avi"), true, true, 10, 10, false); + AutoViewer rippling(true, true, 60, 30, false); + Viewer fractalMandelbrot(MandelbrotProvider::createGL(false), true, true, 120, 60, false); + AutoViewer fractalJulia(true, true, 180, 80, false); + AutoViewer newtown(true, true, 260, 120, false); + AutoViewer heatTransfert(true, false, 1200, 300, false); + GLUTImageViewers::runALL(); + } + else + { + cout << "Command unknown: " << command << endl; + } return EXIT_SUCCESS; }