timer.hpp 432 B

12345678910111213141516171819202122232425262728
  1. #if defined(Hiro_Timer)
  2. @interface CocoaTimer : NSObject {
  3. @public
  4. hiro::mTimer* timer;
  5. NSTimer* instance;
  6. }
  7. -(id) initWith:(hiro::mTimer&)timer;
  8. -(NSTimer*) instance;
  9. -(void) update;
  10. -(void) run:(NSTimer*)instance;
  11. @end
  12. namespace hiro {
  13. struct pTimer : pObject {
  14. Declare(Timer, Object)
  15. auto setEnabled(bool enabled) -> void;
  16. auto setInterval(uint interval) -> void;
  17. CocoaTimer* cocoaTimer = nullptr;
  18. };
  19. }
  20. #endif