7 #include "RipplingImage.h"
8 #include "StringTools.h"
15 /*----------------------------------------------------------------------*\
17 \*---------------------------------------------------------------------*/
19 /*--------------------------------------*\
21 \*-------------------------------------*/
23 /*--------------------------------------*\
25 \*-------------------------------------*/
27 /*----------------------------------------------------------------------*\
29 \*---------------------------------------------------------------------*/
31 /*--------------------------------------*\
33 \*-------------------------------------*/
35 RipplingImage::RipplingImage(unsigned int w
, unsigned int h
, float dt
) :
38 assert(w
==h
); // Image carrer
40 this->ptrRipplingMOO
=new RipplingMOO(w
,h
,dt
);
43 RipplingImage::~RipplingImage(void)
45 delete ptrRipplingMOO
;
48 /*--------------------------------------*\
50 \*-------------------------------------*/
54 * call periodicly by the api
56 void RipplingImage::fillImageGL(uchar4
* ptrTabPixels
, int w
, int h
)
58 ptrRipplingMOO
->process(ptrTabPixels
,w
,h
);
63 * call periodicly by the api
65 void RipplingImage::animationStep(bool& isNeedUpdateView
)
67 ptrRipplingMOO
->animationStep();
72 * call periodicly by the api
74 void RipplingImage::paintPrimitives(Graphic2Ds
& graphic2D
)
76 const Font_A
* ptrFont
= graphic2D
.getFont(TIMES_ROMAN_24
);
81 graphic2D
.setColorRGB(r
, g
, b
);
85 float t
=ptrRipplingMOO
->getT();
87 string message
= "It's up to you! t= " + StringTools::toString(t
);
88 graphic2D
.drawTitleTop(message
, ptrFont
);
93 graphic2D
.drawTitleBottom("Rippling OMP", ptrFont
);
97 /*--------------------------------------*\
99 \*-------------------------------------*/
102 /*----------------------------------------------------------------------*\
104 \*---------------------------------------------------------------------*/