Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_Bilat_FreeGlut_Tools / INC / GLUTCallBackTools.h
1 #ifndef GLUT_CALLBACK_TOOLS_H
2 #define GLUT_CALLBACK_TOOLS_H
3
4 #include "envFreeGlutTools.h"
5 #include "GLUTWindowManagers.h"
6
7 #include <map>
8 using std::map;
9
10 /*
11 * But :
12 *
13 * Cette class permet d'affecter ses Callback a GLUT.
14 *
15 * Exemple :
16 *
17 * glutDisplay(displayGLUTWrapper);
18 * glutXXX(xxxGLUTWrapper);
19 * Probl�me :
20 *
21 * Les m�thodes callback de glut doivent obligatoirement �tre statique. On travail en objet.
22 *
23 * Solution :
24 *
25 * Pour pouvoir "utiliser" les callback glut avec le monde objet, les callback statique appeleront les m�thodes publiques des objets GLUTWindowCustomiser
26 * � l'aide d'une map faisant correspondre l'IdGLUT de la frame � l'objet (GLUTWindowCustomiser) correspondant.
27 */
28 class CBI_FREEGLUT_TOOLS GLUTCallBackTools
29 {
30 public:
31 virtual ~GLUTCallBackTools();
32
33 static void affectAllCallBack(map<unsigned int,GLUTWindow*> mapIDGLUTWindow);
34
35 /*--------------------------------------*\
36 |* Callbacks *|
37 \*-------------------------------------*/
38
39 /**
40 * CallBack pour GLUT
41 * glutXXX(xxx)
42 */
43 static void displayGLUTWrapper();
44 static void reshapeGLUTWrapper(int w, int h);
45 static void mouseMotionGLUTWrapper(int x, int y);
46 static void mouseGLUTWrapper(int button, int state, int x, int y);
47 static void mouseWheelWrapper(int wheel, int direction, int x, int y);
48 static void keyboardGLUTWrapper(unsigned char key, int x, int y);
49 static void specialFuncGLUTWrapper(int key, int x, int y);
50 static void windowCloseWrapper();
51
52 /*--------------------------------------*\
53 |* Get *|
54 \*-------------------------------------*/
55
56
57 static void idleFuncGLUTWrapper();
58
59 //static void postRunWrapper();
60
61 private:
62 GLUTCallBackTools();
63 static void affectCallBack();
64 };
65
66 #endif