Window.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef CORE_WINDOW_H
  2. #define CORE_WINDOW_H
  3. #include <core/Vector.h>
  4. typedef bool (*CoreWindowRunHandler)(void* data);
  5. typedef void (*CoreWindowTickHandler)(void* data);
  6. typedef void (*CoreWindowRenderHandler)(void* data, float lag);
  7. typedef struct {
  8. CoreIntVector2 size;
  9. bool fullscreen;
  10. const char* name;
  11. } CoreWindowOptions;
  12. bool coreWindowOpen(const CoreWindowOptions* options);
  13. void coreWindowClose(void);
  14. void coreWindowShow(void);
  15. void coreWindowTrapCursor(void);
  16. void coreWindowFreeCursor(void);
  17. bool coreWindowIsCursorTrapped(void);
  18. const CoreIntVector2* coreWindowGetSize(void);
  19. bool CoreWindowSizeChanged(void);
  20. bool coreWindowShouldClose(void);
  21. void coreWindowRunHandler(CoreWindowRunHandler wr, void* data);
  22. void coreWindowTickHandler(CoreWindowTickHandler t, void* data);
  23. void coreWindowRenderHandler(CoreWindowRenderHandler r, void* data);
  24. void coreWindowNanosPerTick(i64 nanos);
  25. void coreWindowRun(void);
  26. float coreWindowTicksPerSecond(void);
  27. float coreWindowFramesPerSecond(void);
  28. // namespace Input {
  29. // void setLimit(int limit);
  30. // void reset();
  31. // void enable();
  32. // void disable();
  33. // bool isEnabled();
  34. // void fill(const char* s);
  35. // int getCursor();
  36. // void setCursor(int index);
  37. // const List<uint32>& getUnicode();
  38. //
  39. // template<int N>
  40. // void toString(StringBuffer<N>& s) {
  41. // for(uint32 c : getUnicode()) {
  42. // s.appendUnicode(c);
  43. // }
  44. // }
  45. // }
  46. // namespace Controls {
  47. // typedef StringBuffer<32> ButtonName;
  48. // typedef int ButtonId;
  49. //
  50. // ButtonId add(const ButtonName& name);
  51. // void bindKey(ButtonId id, int key);
  52. // void bindGamepad(ButtonId id, int gamepadButton);
  53. // void bindMouse(ButtonId id, int mouseButton);
  54. //
  55. // Vector2 getLastMousePosition();
  56. // Vector2 getMousePosition();
  57. // Vector2 getLeftGamepadAxis();
  58. // Vector2 getRightGamepadAxis();
  59. // float getLeftGamepadTrigger();
  60. // float getRightGamepadTrigger();
  61. //
  62. // bool isDown(ButtonId id);
  63. // int getDownTime(ButtonId id);
  64. // bool wasReleased(ButtonId id);
  65. // const ButtonName& getName(ButtonId id);
  66. // }
  67. #endif