Creation de viewer pour faciliter l'activation ou non des differents codes des labos.
[GPU.git] / WCudaMSE / Student_Cuda_Image / src / cpp / core / mainGL.cpp
1 #include <iostream>
2 #include <stdlib.h>
3 #include <string.h>
4
5 #include "GLUTImageViewers.h"
6
7 #include "Device.h"
8 #include "cudaTools.h"
9
10 #include "Rippling0Provider.h"
11 #include "RipplingProvider.h"
12
13 #include "FractalProvider.h"
14
15 using std::cout;
16 using std::endl;
17 using std::string;
18
19 class RipplingViewer
20 {
21 public:
22 RipplingViewer()
23 : ptrRippling0(Rippling0Provider::createGL()), ptrRippling(RipplingProvider::createGL()),
24 rippling0Viewer(this->ptrRippling0, true, true, 0, 0),
25 ripplingViewer(this->ptrRippling, true, true, 20, 20)
26 {}
27 ~RipplingViewer()
28 {
29 delete this->ptrRippling0;
30 delete this->ptrRippling;
31 }
32 private:
33 Rippling0Image* ptrRippling0;
34 Image* ptrRippling;
35 GLUTImageViewers rippling0Viewer, ripplingViewer;
36 };
37
38 class FractalViewer
39 {
40 public:
41 FractalViewer()
42 : ptrMandelbrot(FractalProvider::createMandelbrotGL()), ptrJulia(FractalProvider::createJuliaGL()),
43 mandelbrotViewer(this->ptrMandelbrot, true, true, 0, 0),
44 juliaViewer(this->ptrJulia, true, true, 20, 20)
45 {}
46 ~FractalViewer()
47 {
48 delete this->ptrMandelbrot;
49 delete this->ptrJulia;
50 }
51 private:
52 ImageFonctionel* ptrMandelbrot;
53 ImageFonctionel* ptrJulia;
54 GLUTImageViewers mandelbrotViewer, juliaViewer;
55 };
56
57 int mainGL(void)
58 {
59 // RipplingViewer rippling;
60 // FractalViewer fractals;
61
62 GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte
63
64 return EXIT_SUCCESS;
65 }