imagine_CallbackManager:registerCallback(imagine.Callback.CallbackManager.FRAME_STARTED,"frameStart");
imagine_CallbackManager:registerCallback(imagine.Callback.CallbackManager.KEY_PRESSED,"keyPress");  
imagine_CallbackManager:registerCallback(imagine.Callback.CallbackManager.KEY_RELEASED,"keyReleased");
imagine_CallbackManager:registerCallback(imagine.Callback.CallbackManager.WINDOW_CLOSED,"windowClosed");
imagine_CallbackManager:registerCallback (imagine.Callback.CallbackManager.WINDOW_FOCUSCHANGE,"windowFocusChanged");

imagine_CallbackManager:registerCallback(imagine.Callback.CallbackManager.MOUSE_MOVED,"mouseMoved");
imagine_CallbackManager:registerCallback(imagine.Callback.CallbackManager.MOUSE_PRESSED,"mousePressed");
imagine_CallbackManager:registerCallback(imagine.Callback.CallbackManager.MOUSE_RELEASED,"mouseReleased");

请问一下这个是做什么的啊?谢谢啦!

推荐图书

  • C++ Primer中文版(第4版)
  • More Effective C++:35个改善编程与设计的有效方法(中文版)
  • 设计模式:可复用面向对象软件的基础


1个回答

注册回调函数。

注册过函数以后,当有事件发生的时候(鼠标光标移动,鼠标键按下),就会自动调用被注册的函数。