6eed6e371185638536f3e29868fb33f05c1c6417
[GPU.git] / WCudaMSE / Student_Cuda_Image / src / cpp / core / mainGL.cpp
1 #include <iostream>
2 #include <stdlib.h>
3 #include <string.h>
4 using namespace std;
5
6 #include "GLUTImageViewers.h"
7
8 #include "Device.h"
9 #include "cudaTools.h"
10
11 #include "Rippling0Provider.h"
12 #include "RipplingProvider.h"
13 #include "FractalProvider.h"
14 #include "NewtonProvider.h"
15 #include "HeatTransfertProvider.h"
16
17 template <class TOutput, class TProvider>
18 class Viewer
19 {
20 private:
21 TOutput* ptrProvider;
22 GLUTImageViewers viewer;
23
24 public:
25 Viewer(bool isAnimation, bool isSelection, int pxFrame, int pyFrame):
26 ptrProvider(TProvider::createGL()),
27 viewer(ptrProvider, isAnimation, isSelection, pxFrame, pyFrame)
28 {
29 }
30
31 ~Viewer()
32 {
33 delete this->ptrProvider;
34 }
35 };
36
37 int mainGL(void)
38 {
39 //Viewer<Rippling0Image, Rippling0Provider> rippling0(true, true, 10, 10);
40 //Viewer<Image, RipplingProvider> rippling0(true, true, 10, 10);
41 //Viewer<ImageFonctionel, MandelbrotProvider> fractalMandelbrot(true, true, 20, 20);
42 //Viewer<ImageFonctionel, JuliaProvider> fractalJulia(true, true, 30, 30);
43 //Viewer<ImageFonctionel, NewtonProvider> newtown(true, true, 20, 20);
44 Viewer<Image, HeatTransfertProvider> heatTransfert(true, false, 20, 20);
45
46 GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte
47
48 return EXIT_SUCCESS;
49 }