6 #include "StringTools.h"
12 /*----------------------------------------------------------------------*\
14 \*---------------------------------------------------------------------*/
16 /*--------------------------------------*\
18 \*-------------------------------------*/
20 /*--------------------------------------*\
22 \*-------------------------------------*/
24 /*--------------------------------------*\
26 \*-------------------------------------*/
28 /*----------------------------------------------------------------------*\
30 \*---------------------------------------------------------------------*/
32 /*--------------------------------------*\
34 \*-------------------------------------*/
36 Image::Image(Animable_I
* ptrAnimable
,ColorRGB_01
* ptrColorTitreRGB
) :
37 ImageMOOs_A(ptrAnimable
->getW(), ptrAnimable
->getH())
39 this->ptrAnimable
= ptrAnimable
;
40 this->ptrColorTitreRGB
=ptrColorTitreRGB
;
51 void Image::animationStep(bool& isNeedUpdateView
)
53 // cout << "[CBI] : Image : animationStep" <<endl;
55 ptrAnimable
->animationStep();
56 isNeedUpdateView
= true; // true par default
62 void Image::fillImageGL(uchar4
* ptrDevImageGL
, int w
, int h
)
64 // cout << "[CBI] : Image : fillImageGL" <<endl;
66 ptrAnimable
->runGPU(ptrDevImageGL
);
72 void Image::paintPrimitives(Graphic2Ds
& graphic2D
) // redefinition
74 const Font_A
* ptrfont
= graphic2D
.getFont(TIMES_ROMAN_24
);
76 float r
= ptrColorTitreRGB
->r
;
77 float g
= ptrColorTitreRGB
->g
;
78 float b
= ptrColorTitreRGB
->b
;
79 graphic2D
.setColorRGB(r
, g
, b
);
83 float t
= ptrAnimable
->getT();
84 string message
= "t = " + StringTools::toString(t
);
85 graphic2D
.drawTitleTop(message
, ptrfont
);
90 string title
= ptrAnimable
->getTitle();
91 graphic2D
.drawTitleBottom(title
, ptrfont
);
95 /*--------------------------------------*\
97 \*-------------------------------------*/
99 /*----------------------------------------------------------------------*\
101 \*---------------------------------------------------------------------*/