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.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #include "imgui/imgui.h"
  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. private:
  28. static void renderImGui(ImDrawList** const draw_lists, int count);
  29. static bool visible;
  30. static unsigned int fontTex;
  31. static std::string iniFilename;
  32. static std::string logFilename;
  33. static std::list<std::tuple<KeyboardButton, bool>> keyboardEvents;
  34. static std::list<std::tuple<unsigned int, unsigned int, KeyboardButton, bool>> clickEvents;
  35. static std::list<std::tuple<int, int, int, int>> motionEvents;
  36. static std::list<std::tuple<int, int>> scrollEvents;
  37. };
  38. #endif