X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2FmainGL.cpp;h=3d4d02f88f80e42573770ef4ebc869fb4aa487a7;hb=7a1564c56b396cfeb1cbc246fe7b441304364465;hp=44ee7517441366796ea42cebcaf25bf6aadc6a16;hpb=8d08c12b29c2a14684f35c023ee39e694bb80d25;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 44ee751..3d4d02f 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp @@ -10,68 +10,56 @@ #include "Rippling0Provider.h" #include "RipplingProvider.h" +#include "FractalProvider.h" + using std::cout; using std::endl; using std::string; -/*----------------------------------------------------------------------*\ - |* Declaration *| - \*---------------------------------------------------------------------*/ - -/*--------------------------------------*\ - |* Imported *| - \*-------------------------------------*/ - -/*--------------------------------------*\ - |* Public *| - \*-------------------------------------*/ - -int mainGL(void); - -/*--------------------------------------*\ - |* Private *| - \*-------------------------------------*/ - -/*----------------------------------------------------------------------*\ - |* Implementation *| - \*---------------------------------------------------------------------*/ - -/*--------------------------------------*\ - |* Public *| - \*-------------------------------------*/ +class RipplingViewer + { + public: + RipplingViewer() + : ptrRippling0(Rippling0Provider::createGL()), ptrRippling(RipplingProvider::createGL()), + rippling0Viewer(this->ptrRippling0, true, true, 0, 0), + ripplingViewer(this->ptrRippling, true, true, 20, 20) + {} + ~RipplingViewer() + { + 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() + { + delete this->ptrMandelbrot; + delete this->ptrJulia; + } + private: + ImageFonctionel* ptrMandelbrot; + ImageFonctionel* ptrJulia; + GLUTImageViewers mandelbrotViewer, juliaViewer; + }; int mainGL(void) { - Rippling0Image* ptrRippling0 = Rippling0Provider::createGL(); - Image* ptrRippling = RipplingProvider::createGL(); - // TODO : Insert autres Images ... - - bool isAnimation = true; - bool isSelection = true; - - GLUTImageViewers rippling0Viewer(ptrRippling0, isAnimation, isSelection, 0, 0); - GLUTImageViewers ripplingViewer(ptrRippling, isAnimation, isSelection, 10, 10); - // TODO : Insert here autres ImageViewers ... + // RipplingViewer rippling; + // FractalViewer fractals; GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte - // destruction - { - delete ptrRippling0; - delete ptrRippling; - - ptrRippling0 = NULL; - ptrRippling = NULL; - } - return EXIT_SUCCESS; } - -/*--------------------------------------*\ - |* Private *| - \*-------------------------------------*/ - -/*----------------------------------------------------------------------*\ - |* End *| - \*---------------------------------------------------------------------*/ -