PolyiPhoneCore.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 "PolyString.h"
  12. #include "PolyGlobals.h"
  13. #include "PolyCore.h"
  14. #include "PolyRectangle.h"
  15. #include <vector>
  16. using std::vector;
  17. namespace Polycode {
  18. class _PolyExport PosixMutex : public CoreMutex {
  19. public:
  20. pthread_mutex_t pMutex;
  21. };
  22. class iPhoneEvent {
  23. public:
  24. int eventGroup;
  25. int eventCode;
  26. int mouseX;
  27. int mouseY;
  28. TAUKey keyCode;
  29. wchar_t unicodeChar;
  30. char mouseButton;
  31. static const int INPUT_EVENT = 0;
  32. };
  33. class _PolyExport IPhoneCore : public Core {
  34. public:
  35. IPhoneCore(int frameRate);
  36. virtual ~IPhoneCore();
  37. void enableMouse(bool newval);
  38. unsigned int getTicks();
  39. bool Update();
  40. void setVideoMode(int xRes, int yRes, bool fullScreen, int aaLevel);
  41. void createThread(Threaded *target);
  42. void lockMutex(CoreMutex *mutex);
  43. void unlockMutex(CoreMutex *mutex);
  44. CoreMutex *createMutex();
  45. void checkEvents();
  46. vector<Rectangle> getVideoModes();
  47. int lastMouseY;
  48. int lastMouseX;
  49. CoreMutex *eventMutex;
  50. vector<iPhoneEvent> osxEvents;
  51. private:
  52. };
  53. }