Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UI.h 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*!
  2. * \file include/UI.h
  3. * \brief Abstract UI interface
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _UI_H_
  8. #define _UI_H_
  9. #include <functional>
  10. #include <list>
  11. #include <memory>
  12. #include <tuple>
  13. class ImDrawList;
  14. class UI {
  15. public:
  16. static int initialize();
  17. static void eventsFinished();
  18. static void display();
  19. static void shutdown();
  20. static void setVisible(bool v);
  21. static bool isVisible();
  22. static void handleKeyboard(KeyboardButton key, bool pressed);
  23. static void handleText(char* text, bool notFinished);
  24. static void handleMouseClick(unsigned int x, unsigned int y, KeyboardButton button, bool released);
  25. static void handleMouseMotion(int xrel, int yrel, int xabs, int yabs);
  26. static void handleMouseScroll(int xrel, int yrel);
  27. static void handleControllerAxis(float value, KeyboardButton axis);
  28. static void handleControllerButton(KeyboardButton button, bool released);
  29. static void renderImGui(ImDrawList** const draw_lists, int count);
  30. private:
  31. static bool visible;
  32. static unsigned int fontTex;
  33. static std::string iniFilename;
  34. static std::string logFilename;
  35. static bool metaKeyIsActive;
  36. static std::list<std::tuple<KeyboardButton, bool>> keyboardEvents;
  37. static std::list<std::tuple<unsigned int, unsigned int, KeyboardButton, bool>> clickEvents;
  38. static std::list<std::tuple<int, int, int, int>> motionEvents;
  39. static std::list<std::tuple<int, int>> scrollEvents;
  40. };
  41. #endif