Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_Bilat_FreeGlut_Tools / INC / GLUTWindowManagers.h
diff --git a/WCudaMSE/API_Bilat_FreeGlut_Tools/INC/GLUTWindowManagers.h b/WCudaMSE/API_Bilat_FreeGlut_Tools/INC/GLUTWindowManagers.h
new file mode 100755 (executable)
index 0000000..b60c4be
--- /dev/null
@@ -0,0 +1,77 @@
+#ifndef GLUT_WINDOW_MANAGERS_H\r
+#define GLUT_WINDOW_MANAGERS_H\r
+\r
+#include "envFreeGlutTools.h"\r
+#include "GLConfig.h"\r
+#include "GLUTWindow.h"\r
+#include "GLUTCallBackTools.h"\r
+\r
+#include <map>\r
+\r
+using std::map;\r
+\r
+/**\r
+ * input :\r
+ *     pointer to GLImage source\r
+ */\r
+typedef void (*FRERE_MASTER_THREAD)(void**);\r
+\r
+/**\r
+ * On Linux befor using GLUTWindowManagers you have to call :\r
+ *\r
+ *     GLUTWindowManagers::init(&argc,argv);\r
+ *\r
+ * Otherwise OpenGL cannot open and an error message will remind you that you haven't call glutInit !!\r
+ *\r
+ */\r
+class CBI_FREEGLUT_TOOLS GLUTWindowManagers\r
+    {\r
+    private:\r
+       GLUTWindowManagers();\r
+       virtual ~GLUTWindowManagers();\r
+    public:\r
+       static void init(int argc, char** argv);\r
+       static GLUTWindowManagers* getInstance();\r
+       /**\r
+        * Warning Bloquant tand qu'il y a au moins une GLUTWindow d'active!\r
+        * Utiliser la méthode postDisplay de la class GLUTWindowCustomiser_A pour effectuer un traitement après le 1er rendu.\r
+        * Cette méthode postDisplay est appelé dans un thread séparé du display !\r
+        */\r
+       void runALL();\r
+\r
+       /**\r
+        * Use internaly only\r
+        */\r
+       void addWindow(GLUTWindow* glutWindow);\r
+\r
+       /**\r
+        * Use internaly only\r
+        */\r
+       void removeWindow(GLUTWindow* glutWindow);\r
+\r
+       /**\r
+        * Don't use this!\r
+        * Prefering creating a Boost::thread\r
+        * then call runALL(void)\r
+        */\r
+       void runALL(FRERE_MASTER_THREAD methodeFrereMasterThread, void** param);\r
+\r
+       /**\r
+        * Never use!\r
+        * Used only internally!\r
+        */\r
+       map<unsigned int, GLUTWindow*> getMapIdGlutWindow();\r
+\r
+       GLUTWindow* getGLUTWindow(unsigned int glutWindowID);\r
+\r
+    private:\r
+       bool isAllDisplaying();\r
+       static void createDummyOpenGLContext();\r
+\r
+    private:\r
+       map<unsigned int, GLUTWindow*> mapIdGlutWindow;\r
+       static GLUTWindowManagers* singleton;\r
+\r
+    };\r
+\r
+#endif\r