X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2FmainGL.cpp;h=fe29a86d8f8d3b4678e7cd2e6a77aa462a8b749b;hb=2fd5d915e8a9de4d957d6031d2d68088784eac3c;hp=3d4d02f88f80e42573770ef4ebc869fb4aa487a7;hpb=7a1564c56b396cfeb1cbc246fe7b441304364465;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 3d4d02f..fe29a86 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp @@ -1,6 +1,7 @@ #include #include #include +using namespace std; #include "GLUTImageViewers.h" @@ -9,55 +10,40 @@ #include "Rippling0Provider.h" #include "RipplingProvider.h" - #include "FractalProvider.h" +#include "NewtonProvider.h" +#include "HeatTransfertProvider.h" +#include "RayTracingProvider.h" -using std::cout; -using std::endl; -using std::string; - -class RipplingViewer +template +class Viewer { + private: + TOutput* ptrProvider; + GLUTImageViewers viewer; + public: - RipplingViewer() - : ptrRippling0(Rippling0Provider::createGL()), ptrRippling(RipplingProvider::createGL()), - rippling0Viewer(this->ptrRippling0, true, true, 0, 0), - ripplingViewer(this->ptrRippling, true, true, 20, 20) - {} - ~RipplingViewer() + Viewer(bool isAnimation, bool isSelection, int pxFrame, int pyFrame): + ptrProvider(TProvider::createGL()), + viewer(ptrProvider, isAnimation, isSelection, pxFrame, pyFrame) { - delete this->ptrRippling0; - delete this->ptrRippling; } - private: - Rippling0Image* ptrRippling0; - Image* ptrRippling; - GLUTImageViewers rippling0Viewer, ripplingViewer; - }; -class FractalViewer - { - public: - FractalViewer() - : ptrMandelbrot(FractalProvider::createMandelbrotGL()), ptrJulia(FractalProvider::createJuliaGL()), - mandelbrotViewer(this->ptrMandelbrot, true, true, 0, 0), - juliaViewer(this->ptrJulia, true, true, 20, 20) - {} - ~FractalViewer() + ~Viewer() { - delete this->ptrMandelbrot; - delete this->ptrJulia; + delete this->ptrProvider; } - private: - ImageFonctionel* ptrMandelbrot; - ImageFonctionel* ptrJulia; - GLUTImageViewers mandelbrotViewer, juliaViewer; }; int mainGL(void) { - // RipplingViewer rippling; - // FractalViewer fractals; + // 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); + // Viewer heatTransfert(true, false, 20, 20); + // Viewer rayTracing(true, true, 20, 20); GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte