X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FAPI_Bilat_FreeGlut_Tools%2FINC%2FGLUTCallBackTools.h;fp=WCudaMSE%2FAPI_Bilat_FreeGlut_Tools%2FINC%2FGLUTCallBackTools.h;h=187a4baee5696eb57fcfd916ddd1b929dd4fd48e;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/API_Bilat_FreeGlut_Tools/INC/GLUTCallBackTools.h b/WCudaMSE/API_Bilat_FreeGlut_Tools/INC/GLUTCallBackTools.h new file mode 100755 index 0000000..187a4ba --- /dev/null +++ b/WCudaMSE/API_Bilat_FreeGlut_Tools/INC/GLUTCallBackTools.h @@ -0,0 +1,66 @@ +#ifndef GLUT_CALLBACK_TOOLS_H +#define GLUT_CALLBACK_TOOLS_H + +#include "envFreeGlutTools.h" +#include "GLUTWindowManagers.h" + +#include +using std::map; + +/* + * But : + * + * Cette class permet d'affecter ses Callback a GLUT. + * + * Exemple : + * + * glutDisplay(displayGLUTWrapper); + * glutXXX(xxxGLUTWrapper); + * Probl�me : + * + * Les m�thodes callback de glut doivent obligatoirement �tre statique. On travail en objet. + * + * Solution : + * + * Pour pouvoir "utiliser" les callback glut avec le monde objet, les callback statique appeleront les m�thodes publiques des objets GLUTWindowCustomiser + * � l'aide d'une map faisant correspondre l'IdGLUT de la frame � l'objet (GLUTWindowCustomiser) correspondant. + */ +class CBI_FREEGLUT_TOOLS GLUTCallBackTools + { + public: + virtual ~GLUTCallBackTools(); + + static void affectAllCallBack(map mapIDGLUTWindow); + + /*--------------------------------------*\ + |* Callbacks *| + \*-------------------------------------*/ + + /** + * CallBack pour GLUT + * glutXXX(xxx) + */ + static void displayGLUTWrapper(); + static void reshapeGLUTWrapper(int w, int h); + static void mouseMotionGLUTWrapper(int x, int y); + static void mouseGLUTWrapper(int button, int state, int x, int y); + static void mouseWheelWrapper(int wheel, int direction, int x, int y); + static void keyboardGLUTWrapper(unsigned char key, int x, int y); + static void specialFuncGLUTWrapper(int key, int x, int y); + static void windowCloseWrapper(); + + /*--------------------------------------*\ + |* Get *| + \*-------------------------------------*/ + + + static void idleFuncGLUTWrapper(); + + //static void postRunWrapper(); + + private: + GLUTCallBackTools(); + static void affectCallBack(); + }; + +#endif