X-Git-Url: http://git.euphorik.ch/?p=GPU.git;a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2FmainGL.cpp;h=d7a9fec300e5893b85641776d8769ae838163ded;hp=10a939372b5ec27039369b470d0a65712131c41b;hb=6664817ed89b0b616044da35a3eb8f715e0813d9;hpb=ee885ed84f2ff3d5fb1e7ac41fa3c8879314ee36 diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp index 10a9393..d7a9fec 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp @@ -18,18 +18,49 @@ using namespace std; #include "Viewer.h" -int mainGL(void) +int mainGL(const vector& args) { - // AutoViewer rippling0(true, true, 10, 10); - // AutoViewer rippling0(true, true, 10, 10); - // Viewer fractalMandelbrot(MandelbrotProvider::createGL(true), true, true, 20, 20); - // AutoViewer fractalJulia(true, true, 30, 30); - // AutoViewer newtown(true, true, 20, 20); - // AutoViewer heatTransfert(true, false, 20, 20); - // AutoViewer rayTracing(true, true, 20, 20); - Viewer convolution(ConvolutionProvider::createGL("/media/Data/Video/nasaFHD_short.avi"), true, true, 20, 20); - - GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenêtre est ouverte. + const string defaultCommand = "demo"; + const string command = args.size() > 0 ? args[0] : defaultCommand; + + // AutoViewer rippling0(true, true, 10, 10); // Warmup. + + 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 == "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; + } + + // AutoViewer rayTracing(true, true, 20, 20); // Commenté car projet approfondit. return EXIT_SUCCESS; }