Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_Bilat_FreeGlut_Tools / INC / GLUTWindowManagers.h
1 #ifndef GLUT_WINDOW_MANAGERS_H
2 #define GLUT_WINDOW_MANAGERS_H
3
4 #include "envFreeGlutTools.h"
5 #include "GLConfig.h"
6 #include "GLUTWindow.h"
7 #include "GLUTCallBackTools.h"
8
9 #include <map>
10
11 using std::map;
12
13 /**
14 * input :
15 * pointer to GLImage source
16 */
17 typedef void (*FRERE_MASTER_THREAD)(void**);
18
19 /**
20 * On Linux befor using GLUTWindowManagers you have to call :
21 *
22 * GLUTWindowManagers::init(&argc,argv);
23 *
24 * Otherwise OpenGL cannot open and an error message will remind you that you haven't call glutInit !!
25 *
26 */
27 class CBI_FREEGLUT_TOOLS GLUTWindowManagers
28 {
29 private:
30 GLUTWindowManagers();
31 virtual ~GLUTWindowManagers();
32 public:
33 static void init(int argc, char** argv);
34 static GLUTWindowManagers* getInstance();
35 /**
36 * Warning Bloquant tand qu'il y a au moins une GLUTWindow d'active!
37 * Utiliser la méthode postDisplay de la class GLUTWindowCustomiser_A pour effectuer un traitement après le 1er rendu.
38 * Cette méthode postDisplay est appelé dans un thread séparé du display !
39 */
40 void runALL();
41
42 /**
43 * Use internaly only
44 */
45 void addWindow(GLUTWindow* glutWindow);
46
47 /**
48 * Use internaly only
49 */
50 void removeWindow(GLUTWindow* glutWindow);
51
52 /**
53 * Don't use this!
54 * Prefering creating a Boost::thread
55 * then call runALL(void)
56 */
57 void runALL(FRERE_MASTER_THREAD methodeFrereMasterThread, void** param);
58
59 /**
60 * Never use!
61 * Used only internally!
62 */
63 map<unsigned int, GLUTWindow*> getMapIdGlutWindow();
64
65 GLUTWindow* getGLUTWindow(unsigned int glutWindowID);
66
67 private:
68 bool isAllDisplaying();
69 static void createDummyOpenGLContext();
70
71 private:
72 map<unsigned int, GLUTWindow*> mapIdGlutWindow;
73 static GLUTWindowManagers* singleton;
74
75 };
76
77 #endif