PolyiPhoneCore.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * PolyiPhoneCore.h
  3. * Poly
  4. *
  5. * Created by Ivan Safrin on 2/1/10.
  6. * Copyright 2010 Ivan Safrin. All rights reserved.
  7. *
  8. */
  9. // @package Core
  10. #pragma once
  11. #include "PolyGlobals.h"
  12. #include "PolyCore.h"
  13. #include "PolyRectangle.h"
  14. #include <vector>
  15. using std::vector;
  16. namespace Polycode {
  17. class _PolyExport PosixMutex : public CoreMutex {
  18. public:
  19. pthread_mutex_t pMutex;
  20. };
  21. class iPhoneEvent {
  22. public:
  23. int eventGroup;
  24. int eventCode;
  25. int mouseX;
  26. int mouseY;
  27. TAUKey keyCode;
  28. wchar_t unicodeChar;
  29. char mouseButton;
  30. static const int INPUT_EVENT = 0;
  31. };
  32. class _PolyExport IPhoneCore : public Core {
  33. public:
  34. IPhoneCore(int frameRate);
  35. virtual ~IPhoneCore();
  36. void enableMouse(bool newval);
  37. unsigned int getTicks();
  38. bool Update();
  39. void setVideoMode(int xRes, int yRes, bool fullScreen, int aaLevel);
  40. void createThread(Threaded *target);
  41. void lockMutex(CoreMutex *mutex);
  42. void unlockMutex(CoreMutex *mutex);
  43. CoreMutex *createMutex();
  44. void checkEvents();
  45. vector<Rectangle> getVideoModes();
  46. int lastMouseY;
  47. int lastMouseX;
  48. CoreMutex *eventMutex;
  49. vector<iPhoneEvent> osxEvents;
  50. private:
  51. };
  52. }