* Ajout d'un exemple CUDA non-openGL (AddVector.cu)
[GPU.git] / WCudaMSE / Student_Cuda_Image / src / cpp / core / 01_Rippling / moo / host / Rippling.cu
index 6bd9e0c..43068a2 100755 (executable)
@@ -38,22 +38,13 @@ extern __global__ void rippling(uchar4* ptrDevPixels, int w, int h, float t);
  \*-------------------------*/\r
 \r
 Rippling::Rippling(int w, int h, float dt)\r
+    : w(w), h(h), dt(dt), t(0),\r
+      dg(8, 8, 1),\r
+      db(16, 16, 1),\r
+      title("Rippling Cuda")\r
     {\r
     assert(w == h);\r
 \r
-    // Inputs\r
-    this->w = w;\r
-    this->h = h;\r
-    this->dt = dt;\r
-\r
-    // Tools\r
-    //this->dg = // TODO\r
-    //this->db = // TODO\r
-    this->t = 0;\r
-\r
-    // Outputs\r
-    this->title = "Rippling Cuda";\r
-\r
     //print(dg, db);\r
     Device::assertDim(dg, db);\r
     }\r
@@ -72,7 +63,7 @@ Rippling::~Rippling()
  */\r
 void Rippling::animationStep()\r
     {\r
-    // TODO\r
+    this->t += dt;\r
     }\r
 \r
 /**\r
@@ -80,7 +71,7 @@ void Rippling::animationStep()
  */\r
 void Rippling::runGPU(uchar4* ptrDevPixels)\r
     {\r
-    // TODO lancer le kernel avec <<<dg,db>>>\r
+    rippling<<<dg,db>>>(ptrDevPixels, this->w, this->h, this->t);\r
     }\r
 \r
 /*--------------*\\r