X-Git-Url: http://git.euphorik.ch/?p=GPU.git;a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2FmainGL.cpp;h=d2b6adfa87016f91fc6386860b3120afeca1ac68;hp=3d4d02f88f80e42573770ef4ebc869fb4aa487a7;hb=2d95edd9a2d09421e5eae56755bdf3105e12edf7;hpb=19015d26dfb874d075516772ef531ee5e42fa213 diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp index 3d4d02f..d2b6adf 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" -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); + GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte