Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / Tuto_Image / src / cpp / core / 03_Event / image / EventImage.cpp
1 #include <iostream>
2
3 #include "EventImage.h"
4
5
6 using std::cout;
7 using std::endl;
8 using std::string;
9
10 /*----------------------------------------------------------------------*\
11 |* Declaration *|
12 \*---------------------------------------------------------------------*/
13
14 /*--------------------------------------*\
15 |* Public *|
16 \*-------------------------------------*/
17
18 /*--------------------------------------*\
19 |* Private *|
20 \*-------------------------------------*/
21
22 /*----------------------------------------------------------------------*\
23 |* Implementation *|
24 \*---------------------------------------------------------------------*/
25
26 /*--------------------------------------*\
27 |* Public *|
28 \*-------------------------------------*/
29
30 EventImage::EventImage(unsigned int w, unsigned int h) :
31 ImageMOOs_A(w, h)
32 {
33 control();
34 }
35
36 EventImage::~EventImage(void)
37 {
38 delete ptrKeyListener;
39 delete ptrMouseListener;
40 }
41
42 /*--------------------------------------*\
43 |* Override *|
44 \*-------------------------------------*/
45
46
47 /**
48 * Override
49 * call periodicly by the api
50 */
51 void EventImage::fillImageGL(uchar4* ptrTabPixels, int w, int h)
52 {
53 // vide
54 }
55
56 /**
57 * Override
58 * call periodicly by the api
59 */
60 void EventImage::animationStep(bool& isNeedUpdateView)
61 {
62 // rien
63 }
64
65 /**
66 * Override
67 * call periodicly by the api
68 */
69 void EventImage::paintPrimitives(Graphic2Ds& graphic2D)
70 {
71 const Font_A* ptrFont = graphic2D.getFont(TIMES_ROMAN_24);
72
73 float r = 1;
74 float g = 0;
75 float b = 0;
76 graphic2D.setColorRGB(r, g, b);
77
78 // Bottom
79 {
80 graphic2D.drawTitleBottom("API Image : Click on the windows, and look message in the console", ptrFont);
81 }
82 }
83
84 /*--------------------------------------*\
85 |* Private *|
86 \*-------------------------------------*/
87
88 void EventImage::control(void)
89 {
90 this->ptrKeyListener = new SimpleKeyListener();
91 this->ptrMouseListener = new SimpleMouseListener();
92
93 setKeyListener(ptrKeyListener);
94 setMouseListener(ptrMouseListener);
95 }
96
97 /*----------------------------------------------------------------------*\
98 |* End *|
99 \*---------------------------------------------------------------------*/
100